[Python-Dev] Startup time
Jeff Epler
jepler@unpythonic.net
Wed, 14 May 2003 13:08:03 -0500
On Wed, May 14, 2003 at 01:02:42PM -0500, Skip Montanaro wrote:
>
> Jeremy> Guido and I looked at that briefly. It doesn't make any
> Jeremy> difference does it? The functions that use re are called when
> Jeremy> the module is imported.
>
> You're right. I'll come up with something.
I'd suggested (or I think I suggested) that re needs to only be imported
when message != "" in filterwarnings. The other use, in _processoptions
-> _setoption, is only hit when sys.warnoptions has a non-empty value.
This still leaves the usage of re in
encodings.__init__.normalize_encoding() which I also suggested moving
into the function --however, I never checked when .normalize_encoding()
is called, so it might always be hit at startup anyway. This could also
be rewritten as string operations, too.
Jeff