quad: Import sympy only when necessary#459
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.
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.
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.