-
Notifications
You must be signed in to change notification settings - Fork 747
PythonEngine.Initialize slow #598
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
Comments
We already have PR for that problem. See #528 Also try to build python.net from the branch https://github.com/pythonnet/pythonnet/tree/featured |
I don't fully understand the idea of eager initialization of the cache in ModuleObject.LoadNames when other members of ModuleObject use lazy caching. At least in my use case (using only a couple of methods of the 50+ module namespaces) this seems to be a bad tradeoff. Are there any benchmarks to justify this design? |
Just tested the branch https://github.com/pythonnet/pythonnet/tree/featured. Response time is down to 200 ms with eager initialization of 50+ module namespaces. Thanks for your help! |
@dmitriyse When will this fix be incorporated into a release? The branch https://github.com/pythonnet/pythonnet/tree/featured seems to work great, but it doesn't appear that master has these changes. Thanks. |
this is now in master branch: #723 |
Environment
Details
When embedding Python in an ASP.NET MVC 5 web application, PythonEngine.Initialize needs a couple of seconds to eagerly load the names of around 50 module namespaces in ModuleObject.LoadNames. If I replace the implementation of LoadNames with a NOP, time spent in PythonEngine.Initialize drops to below 100 ms and the web application still seems to work.
The text was updated successfully, but these errors were encountered: