Skip to content

Very Slow Python Initialize #703

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
williamrubens opened this issue Jul 12, 2018 · 8 comments
Closed

Very Slow Python Initialize #703

williamrubens opened this issue Jul 12, 2018 · 8 comments

Comments

@williamrubens
Copy link

Environment

Pythonnet version: 2.3.0
Python version: Python 3.5 (conda environment)
Operating System: Windows 10 64bit
VS 2017

Details

Hi guys, thanks for the great work building a super useful library. One question, and this could be expected behavior, I'm not sure. When I initialize the python interpreter on the .Net side, with this call:

using (Py.GIL()) {

I've timed it and it takes about 2 mins to complete the call. Further calls to grab python lock return immediately. I've also noticed that in visual studio my output window I see thousands of messages of this form:

Exception thrown at 0x00007FFE37F73C58 in RSUser.exe: Microsoft C++ exception: EEFileLoadException at memory location 0x000000314CBFB8F0.
Exception thrown at 0x00007FFE37F73C58 in RSUser.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000.
Exception thrown at 0x00007FFE37F73C58 in RSUser.exe: Microsoft C++ exception: EEFileLoadException at memory location 0x000000314CBFB8F0.
Exception thrown: 'System.IO.FileNotFoundException' in mscorlib.dll
Exception thrown at 0x00007FFE37F73C58 in RSUser.exe: Microsoft C++ exception: EEFileLoadException at memory location 0x000000314CBFB8F0.
Exception thrown at 0x00007FFE37F73C58 in RSUser.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000.

@filmor
Copy link
Member

filmor commented Jul 23, 2018

I have never observed this, can you disclose your test sample?

@den-run-ai
Copy link
Contributor

den-run-ai commented Jul 24, 2018 via email

@williamrubens
Copy link
Author

I switched to running under release and it's much faster, takes around 40 seconds now, though I can still thousands of exceptions in the output window. Sounds like it could be some VS settings... any ideas which ones to play with?

@inna-w
Copy link
Contributor

inna-w commented Aug 21, 2018

This issue was discussed before: #598.
The solution proposed by @dmitriyse there worked for me - we are using build from featured branch. This also solved crashes on obfuscated types names in 3rd party assemblies.

@williamrubens
Copy link
Author

Switching to using the featured branch has solved the thousands of exceptions problem. It's also now quite speedy in release mode. It still takes forever in debug mode.

@den-run-ai
Copy link
Contributor

@williamrubens PR #723 should add this feature once merged into master.

@den-run-ai
Copy link
Contributor

closed by #723

@simonbuehler
Copy link

I'm still having the very same issue with those exceptions beeing thrown and a very slow startup behaviour, is this normal or how can i debug this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants