[Python-Dev] Startup time

Neal Norwitz neal@metaslash.com
Tue, 06 May 2003 14:37:21 -0400


On Tue, May 06, 2003 at 08:20:42PM +0200, Alex Martelli wrote:
> On Tuesday 06 May 2003 07:37 pm, Martin v. L=F6wis wrote:
> > Jeff Epler <jepler@unpythonic.net> writes:
> > > Comparing 2.2 and 2.3, there are a lot of files opened in 2.3 t=
hat
> > > aren't in 2.2.
>=20
> [alex@lancelot blm]$ strace -e stat64 python2.2 -S -c pass 2>&1 | w=
c -l
>      18
> [alex@lancelot blm]$ strace -e stat64 python2.3 -S -c pass 2>&1 | w=
c -l
>      71

I think amny of the extra stat/open calls are due to zipimports.

I don't have python23.zip, but it's still looking for a bunch
of extra files that can't exist (in python23.zip).  Perhaps
if the zip file doesn't exist, we can short circuit the remaining
calls to open()?

stat64("/home/neal/local/lib/python23.zip/warnings", 0xbfffebc0) =
=3D -1 ENOENT (No such file or directory)
open("/home/neal/local/lib/python23.zip/warnings.so", O_RDONLY|O_LARG=
EFILE) =3D -1 ENOENT (No such file or directory)
open("/home/neal/local/lib/python23.zip/warningsmodule.so", O_RDONLY|=
O_LARGEFILE) =3D -1 ENOENT (No such file or directory)
open("/home/neal/local/lib/python23.zip/warnings.py", O_RDONLY|O_LARG=
EFILE) =3D -1 ENOENT (No such file or directory)
open("/home/neal/local/lib/python23.zip/warnings.pyc", O_RDONLY|O_LAR=
GEFILE) =3D -1 ENOENT (No such file or directory)

Neal