Xavier Olive research teaching python blog til cli

Monitor slow Python imports

16 April 2022

It is very easy to get drifted as you write your Python library and let your library import just everything instead of sticking to a more efficient import-as-you-need approach.

The following command lines with the tuna command.

python -X importtime -c "from package import module" 2> import.log
tuna import.log