[Python-Dev] 2.3 startup speed?

Jeremy Hylton jeremy@zope.com
11 Jul 2003 10:37:32 -0400


I've got a plan, which I'll implement today unless someone can find a
hole in it.  The warnings module stores 5-tuples of filter information,
including two compiled regular expressions.  There are two filters
installed by default, which is why we load re during startup.

The two default filters use the regular expression "".  So we're getting
absolutely no benefit from those regular expressions.   I propose to
modify the two regex slots in the filter tuple to also store None, where
None means matching anything.

If we make that change, then we can install the default filters without
importing re.  A quick test of this change improved startup time by 20%.

Unfortunately, even with a 20% boost, it still takes twice as long to do
python -c "pass".

Jeremy