[Python-Dev] Startup time

Jeff Epler jepler@unpythonic.net
Tue, 6 May 2003 13:36:00 -0500


On Tue, May 06, 2003 at 07:37:46PM +0200, Martin v. L=F6wis wrote:
> Jeff Epler <jepler@unpythonic.net> writes:
>=20
> > Comparing 2.2 and 2.3, there are a lot of files opened in 2.3 that
> > aren't in 2.2.
>=20
> Very interesting. Could you also try to find out the difference in
> terms of stat calls?
# redhat's 9 2.2.2
$ strace -e stat64 python -S -c pass 2>&1 | wc -l
     11
# python.org's 2.3b1
$ strace -e stat64 ./python -S -c pass 2>&1 | wc -l
     72

By the way, I was able to account for the wall-time difference I saw
due to the fact that my PYTHONPATH contains some directories on NFS,
and so the attempted open()s and stat()s of standard modules did take
measurable wall time.

With no PYTHONPATH variable set, these are the startup timings I see:
# 2.2.2
real    0m0.005s
user    0m0.000s
sys     0m0.000s

# 2.3b2
real    0m0.044s
user    0m0.020s
sys     0m0.020s

By the way, I wouldn't be too excited about trusting this Python --
    ./python -c "import random"
    Illegal instruction
I wonder what's gone wrong...
(gdb) run -c "import random"
Starting program: /usr/src/Python-2.3b1/python -c "import random"
[New Thread 1074963072 (LWP 28408)]

Program received signal SIGILL, Illegal instruction.
[Switching to Thread 1074963072 (LWP 28408)]
0x08109aa0 in subtype_getsets_full ()
(gdb) where
#0  0x08109aa0 in subtype_getsets_full ()
#1  0x4001c743 in random_new (type=3D0x4001c738, args=3D0x4012c02c, kwds=3D=
0x0)
               at /usr/src/Python-2.3b1/Modules/_randommodule.c:439
(gdb) ptype subtype_getsets_full
type =3D struct PyGetSetDef {
[...]

I'm recompiling now to see if it was just a bogon strike.. surely somebod=
y
else has tested on redhat9!  nope, recompiled and I still have the proble=
m.
and I can't get the debugger to stop at the top of random_new either.

jeff