-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
quad: Import sympy only when necessary #459
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
Conversation
|
With the second commit, it goes from ~4.6s to ~2s. |
|
|
|
|
|
Do we really need these tests
? Ref #109 |
oyamad
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change (in the second commit) makes one of the _probvec_* functions complied for every call, which I am afraid is inefficient.
|
Adding |
|
OK, I removed the guvectorize commit. I suppose I should have timed the hot start that has the numba caches ready. |
@oyamad did you mean |
|
On
|
|
@rht Yes, |
|
+1 for 2. lazy import of |
oyamad
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done, this is very helpful!
|
I think selective imports works well -- when done like this. Is there any PEP guidance to this? |
|
The only article I found documenting various options to do lazy import: https://snarky.ca/lazy-importing-in-python-3-7/ (note: the author wrote |
|
See also: numpy/numpy#11457. |
|
thanks @rht - this is a great improvement! Also thanks for those links. Lazy importing makes a lot of sense. |

This
partially addressesfixes #449. Theimport quantecontime on my machine decreases from ~5.4s to4.6sto ~1s.