[Python-Dev] Startup time

Jeremy Hylton jeremy@zope.com
14 May 2003 13:45:33 -0400


On Wed, 2003-05-14 at 13:35, Skip Montanaro wrote:
>     Jeremy> I don't know if this thread came to any conclusion.  
> 
> I don't think so.  I think it bogged down about the time I suggested that
> executing import from within a function might slow things down.
> 
>     Jeremy> The use of re in the warnings module seems the primary culprit,
>     Jeremy> since it pulls in re, sre and friends, string, and strop.
> 
> I just peeked at warnings.py.  None of the uses of re.* in there seem like
> they'd be in time-critical functions.  The straightforward change (migrate
> "import re" into the functions which use the module) worked for me, so I
> went ahead and checked it in.

Guido and I looked at that briefly.  It doesn't make any difference does
it?  The functions that use re are called when the module is imported.

Jeremy