Closed brisvag closed 3 years ago
Excessively slower than importing napari?
I guess you're right... I tried to do some profiling a few weeks back, but maybe I misunderstood the causes. If some dependencies are already imported (especially napari) things are faster
In [1]: %time import numpy
CPU times: user 103 ms, sys: 9.95 ms, total: 113 ms
Wall time: 112 ms
In [2]: %time import pandas
CPU times: user 231 ms, sys: 53.5 ms, total: 284 ms
Wall time: 284 ms
In [3]: %time import napari
CPU times: user 1.21 s, sys: 96.4 ms, total: 1.3 s
Wall time: 1.31 s
In [4]: %time import peepingtom
CPU times: user 400 ms, sys: 43.3 ms, total: 443 ms
Wall time: 443 ms
as opposde to:
In [1]: %time import peepingtom
CPU times: user 1.69 s, sys: 203 ms, total: 1.89 s
Wall time: 1.9 s
Still, I'm sure there are wayt to lazyfying some of these imports.
I think we can consider this closed by #113 .
Something about importing the package is very slow. Some profiling is needed, I'm sure there are improvements to be made, There's probably a lot of messy nested imports that could be prevented.