Closed adler-j closed 6 years ago
It feels like running import odl is becomming so slow you really notice it, and this is irritating.
Totally agree. Just today I did a much simpler exercise and compared full import times with other packages. Dropping out of Spyder and into IPython on the console and using this function
from time import time
import importlib
def test_import(pkg):
t_start = time()
importlib.import_module(pkg)
t_end = time() - t_start
print('Imported {} in {} seconds'.format(pkg, t_end))
we have
test_import('odl')
: 0.39207029342651367 secondstest_import('numpy')
: 0.0570526123046875 secondstest_import('matplotlib.pyplot')
: 0.18544530868530273 secondsResults seem to vary a bit depending on IPython vs. plain Python console and IDE vs. plain console. Times for importing ODL:
Probably, caching also plays a role. Earlier today times were much worse. If I remove all .pyc files, ODL imports in 0.5289430618286133 seconds in a non-IDE IPython console.
This is now significantly improved. Closing.
It feels like running
import odl
is becomming so slow you really notice it, and this is irritating.A short profiling using pyinstrument gave me this modest output from
import odl
.Here we see that there are a few main culprits in the long loading time:
Of these, I see that we should be able to fix at least the first 3, which should bring startup down to 0.5s which I think is more acceptable.