Pyhton Interpreter Startup time

Miki Tebeka miki.tebeka at zoran.com
Sun Aug 15 05:08:41 EDT 2004


Hello Neil,

>          I'm looking at a small app which would need a very quick 
> startup time for the Python interpreter.  It doesn't do much (copying 
> and caching of files, no GUI) but I need the Python interpreter to start 
> up very quickly (<1 second on a Windows box).  Is there a way to have a 
> 'stripped' down Python interpreter which can start up very quickly on a 
> windows box.  Once thing I was thinking of was to use PyExe to make a 
> quick startup (does it compile down to C code, therefore not using the 
> Python interpreter at runtime?).  Is this a possible solution?
> 
>    I observe that the second time I start python it starts up quicker 
> but I'm assuming that this is dependent on the environment and can't be 
> relied upon (or something like that).
My guess it's that Windows first load of python23.dll takes time. The
second time it's already in memory and Python loads faster.

Windows have a list of "KnownDLLs" that it pre loads at startup time and
they stay in memory all the time. To see if this is the problem try adding the
python23.dll to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
Manager\KnownDLLs

(The above is *one* line with space between "Session" and "Manager")

HTH.
--
------------------------------------------------------------------------
Miki Tebeka <miki.tebeka at zoran.com>
http://tebeka.spymac.net
The only difference between children and adults is the price of the toys



More information about the Python-list mailing list