Improving interpreter startup speed

Benjamin Kaplan benjamin.kaplan at case.edu
Sun Oct 26 14:12:17 EDT 2008


On Sun, Oct 26, 2008 at 1:45 PM, BJörn Lindqvist <bjourne at gmail.com> wrote:

> 2008/10/26 James Mills <prologic at shortcircuit.net.au>:
> > On Sun, Oct 26, 2008 at 11:23 AM, BJörn Lindqvist <bjourne at gmail.com>
> wrote:
> >> How are you getting those numbers? 330 μs is still pretty fast, isn't
> >> it? :) Most disks have a seek time of 10-20 ms so it seem implausible
> >> to me that Ruby would be able to cold start in 47 ms.
> >
> > $ time python -c "pass"
> >
> > real    0m0.051s
> > user    0m0.036s
> > sys     0m0.008s
>
> Pedro was talking about cold startup time:
>
> $ sudo sh -c "echo 3 > /proc/sys/vm/drop_caches"
> $ time python -c "pass"
>
> real    0m0.627s
> user    0m0.016s
> sys     0m0.008s
>
> That is quite a lot and for short scripts the startup time can easily
> dominate the total time.
>
> > And yes I agree. the CPython interpreter startup times is
> > a stupid thing to be worrying about, especially since that
> > is never the bottleneck.
>
> I disagree. The extra time Python takes to start makes it unsuitable
> for many uses. For example, if you write a simple text editor then
> Pythons longer startup time might be to much.
>

You must be in a real big hurry if half a second matters that much to you.
Maybe if it took 5 seconds for the interpreter to start up, I could
understand having a problem with the start up time.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20081026/19f879d0/attachment.html>


More information about the Python-list mailing list