[Python-Dev] Startup time

Skip Montanaro skip@pobox.com
Wed, 14 May 2003 12:35:13 -0500


    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.

Skip