[Python-Dev] Python startup time

Antoine Pitrou solipsis at pitrou.net
Wed Oct 9 12:29:56 CEST 2013


Le Wed, 9 Oct 2013 10:29:30 +0200,
Antoine Pitrou <solipsis at pitrou.net> a écrit :
> Le Tue, 8 Oct 2013 15:43:40 -0400,
> Benjamin Peterson <benjamin at python.org> a écrit :
> 
> > 2013/10/8 R. David Murray <rdmurray at bitdance.com>:
> > > In this context, if we'd been *really* smart-lazy in CPython
> > > development, we'd have kept the memory and startup-time
> > > and...well, we probably do pretty well on CPU actually...smaller,
> > > so that when smartphones came along Python would have been the
> > > first high level language used on them, because it fit.  Then
> > > we'd all be able to be *much* lazier now :)
> > 
> > Even on desktop, startup time leaves a lot to be desired.
> 
> That's true. Anyone have any ideas to improve it?

It's difficult to identify significant contributors but some possible
factors:
- marshal.loads() has become twice slower in 3.x (compared to 2.7)
- instantiating a class is slow (type('foo', (), {}) takes around 25ms
  here)

Regards

Antoine.




More information about the Python-Dev mailing list