[Python-Dev] To reduce Python "application" startup time

Neil Schemenauer nas at arctrix.com
Thu Sep 7 01:30:41 EDT 2017

INADA Naoki <songofacandy at gmail.com> wrote:
> Current `python -v` is not useful to optimize import.
> So I use this patch to profile import time.
> https://gist.github.com/methane/e688bb31a23bcc437defcea4b815b1eb

I have implemented DTrace probes that do almost the same thing.
Your patch is better in that it does not require an OS with DTrace
or SystemTap.  The DTrace probes are better in that they can be a
part of the standard Python build.


DTrace script:


Pretty printer for script output (very minimal):


More information about the Python-Dev mailing list