[Python-Dev] PEP 3147: PYC Repository Directories

Terry Reedy tjreedy at udel.edu
Mon Feb 8 17:46:14 CET 2010

On 2/8/2010 7:54 AM, Nick Coghlan wrote:
> Ron Adam wrote:
>> To tell the truth in most cases I hardly notice the extra time the first
>> run takes compared to later runs with the precompiled byte code.  Yes it
>> may be a few seconds at start up, but after that it's usually not a big
>> part of the execution time.  Hmmm, I wonder if there's a threshold in
>> file size where it really doesn't make a significant difference?
> It's relative to runtime for the application itself (long-running
> applications aren't going to notice as much of a percentage effect on
> runtime) as well as to how many Python files are actually imported at
> startup (only importing a limited number of modules, importing primarily
> extension modules or effective use of a lazy module loading mechanism
> will all drastically reduce the proportional impact of precompiled bytecode)
> We struggle enough with startup time that doing anything that makes it
> slower is rather undesirable though.

Definitely. I have even wondered whether it would be possible to cache 
not just the bytecode for initializing a module, but also the 
initialized module itself (perhaps minus the name bindings for other 
imported modules).

Terry Jan Reedy

More information about the Python-Dev mailing list