Python Performance

kuniga.me > Docs > Python Performance

Python Performance

Start Up Times

Profiling

Detecting Expensive Modules

We can determine which module is taking the most time to import by running a binary with the -X importtime flag:

pip install tuna
python -X importtime tdigest/tdigest.py 2> /tmp/import.log
tuna /tmp/import.log

Source: Revisiting Python: Modules.