-
Notifications
You must be signed in to change notification settings - Fork 212
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
pkg_resources causes a slow import; any way to avoid? #291
Comments
Shouldn't be a problem with replacing this with a tuple. |
Tuple comparison on splitting on '.' seems to work fine. Technically Test fragments:
I can't think of any other weird numbered variations that should break the tuple of strings comparison. Testing import times:
Before patch:
After patch:
So something is still slow about NumExpr 2.6 compared to the dev branch. |
I moved the imports for |
Suggested changes: The only remaining slow-down that I can think of is that the circular imports between |
Agreed. A 3x improvement in numexpr 2 is good enough already 👍 |
Apparently resolved? Maybe we could get a heads up whenever the next |
The use of pkg_resources.parse_version (see #162) causes the import time of numexpr to slow down significantly, from approx 0.4 seconds without pkg_resources.parse_version to 2.1 seconds with pkg_resources.parse_version.
(perhaps I should note that I am not a direct consumer of numexpr and have never used it, but pandas does and I use pandas)
Please consider alternate methods... if there are any.
The culprit is in expressions.py
(my "speedup" was to comment out those last two lines referencing parse_version and substitute
_np_version = '1.12.1'
just to see how this impacts import time)(see also pypa/setuptools#510)
The text was updated successfully, but these errors were encountered: