python startup very slow on win2000

Jeff Epler jepler at unpythonic.net
Thu Jul 29 13:20:42 CEST 2004


Then you've at least learned something: Files loaded due to site.py, or
files on PYTHONPATH, add 3-4 seconds to start time.

However, 6-7 seconds for "python -vc 'print 1'" is still excessive.
That takes only 1/2 second here, and "python -c 'print 1'" takes 0.05
seconds (the difference being the time to print all the "-v" lines,
basically).  (This is on an 650MHz Unix machine--A modern 2.7GHz Unix
machine I just tested took 0.005 seconds for "python -SEc 'print 1'")

The number one reason I've seen for slow Python startups are sys.path
directories on the network (from personal experience).  Other problems
might be importing modules from directories without .pyc files and
without write permissions (Python must parse and byte-compile the source
files each time), or a module being imported attempts to do some
network-related activity, such as find the hostname, but your network is
misconfigured.

... or it could be some obscure Microsoft Windows misconfiguration that
we'll never guess in a million years.

Jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20040729/d21da21d/attachment.pgp>


More information about the Python-list mailing list