Skip to content

Very Slow Python Initialize #703

Closed
Closed

Description

@williamrubens

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.

Activity

  1. filmor commented on Jul 23, 2018

    @filmor
    Member

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

  2. den-run-ai commented on Jul 24, 2018

    @den-run-ai
    Contributor
  3. williamrubens commented on Aug 16, 2018

    @williamrubens
    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?

  4. inna-w commented on Aug 21, 2018

    @inna-w
    Contributor

    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.

  5. williamrubens commented on Sep 13, 2018

    @williamrubens
    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.

  6. den-run-ai commented on Sep 14, 2018

    @den-run-ai
    Contributor

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

  7. den-run-ai commented on Nov 14, 2018

    @den-run-ai
    Contributor

    closed by #723

  8. simonbuehler commented on Jan 29, 2020

    @simonbuehler

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions