Closed apiszcz closed 4 years ago
Thanks for posting this. I wasn't aware of importtime
. 8.7 s does seem like a lot. On my humble laptop (the base-model 2016 MacBook Pro), trackpy takes about 1.6 s, so perhaps there is something else going on.
On my system, and in the sample you pasted, it looks like the trackpy modules themselves have reasonably short load times; it's just that import trackpy
also imports a huge swath of the scientific Python and image I/O ecosystem, that many people would use anyway even if they didn't use trackpy. Pandas, numpy, scipy, matplotlib, IPython, and numba alone account for more than half of the time. That said, that's not true in every use case—there are applications of trackpy that don't require matplotlib or pims, for example.
Here's the output of python -X importtime -c 'import trackpy' 2> importtime.txt
: importtime.txt
Reviewing startup times on python programs i am seeing the longest module load times from trackpy. This may be my environment or some other local issue. trackpy is taking 8,785,844 microseconds to load. Python 3.7 reports import times by using python -X importime yourprogram.py
Trackpy is the highest peak around x=2600.