Speed of Python vs. Perl

Tim Peters tim.one at home.com
Thu Jan 11 21:22:46 EST 2001


[Paul Jackson]
> I believe that it's actually more cpu bound, parsing the imports
> once it finds them, than it is disk bound, trying to stat or
> open them.

Unless you've got a broken installation, Python shouldn't be spending *any*
time parsing imported files at startup.  That's what .pyc files are for:  a
given module should be parsed only once in its entire lifetime.  Use the
"-v" switch to see whether you're importing files in .py or .pyc form; if
the former, you've got a platform bug somewhere (or perhaps have stored your
Python libraries in a non-writable directory, so that Python can't create
the .pyc forms).

> See further my more detailed analysis:
>
>     http://deja.com/getdoc.xp?AN=652983262
>     Subject: Re: How does Python compare to ?
>     Date: 07/31/2000
>     Author: Paul Jackson <pj at sgi.com>





More information about the Python-list mailing list