[Python-Dev] Startup time

Alex Martelli aleax@aleax.it
Tue, 6 May 2003 19:49:52 +0200


On Tuesday 06 May 2003 06:21 pm, Jeff Epler wrote:
   ...
> # Number of attempts to open an existing file
> $ strace -e open python -S -c pass 2>&1 | grep -v ENOENT | wc -l
>       8
> $ strace -e open ./python -S -c pass 2>&1 | grep -v ENOENT | wc -l
>      46

Yes, same here (2.2.2 and 2.3 from CVS both built locally with Mdk 9.0).

Besides the .py and .pyc for all the modules, there's a few more files
that 2.3 is opening and 2.2 isn't:

early on:
open("/usr/lib/libstdc++.so.5", O_RDONLY) = 3
open("/lib/libgcc_s.so.1", O_RDONLY)    = 3

in the midst of the imports (just before encodings/__init__.py):
open("/usr/share/locale/locale.alias", O_RDONLY) = 3
open("/usr/share/locale/en_US/LC_CTYPE", O_RDONLY) = 3


Alex