[Python-Dev] Store startup modules as C structures for 20%+ startup speed improvement?

Antoine Pitrou solipsis at pitrou.net
Tue Sep 18 04:31:42 EDT 2018

On Mon, 17 Sep 2018 17:23:26 -0700
Carl Shapiro <carl.shapiro at gmail.com> wrote:
> > To give an idea, on my machine the baseline Python startup is about 20ms
> > (`time python -c pass`), but if I import Numpy it grows to 100ms, and
> > with Pandas it's more than 200ms.  Saving 4ms on the baseline startup
> > would make no practical difference for concrete usage.
> >  
> Do you have a feeling for how many of those milliseconds are spend loading
> bytecode from disk?

No idea.  In my previous experiments with module import speed, I
concluded that executing module bytecode generally was the dominating
contributor, but that doesn't mean loading bytecode is costless.



More information about the Python-Dev mailing list