Floris Bruynooghe wrote:

Can't it look for a .py file in the source directory first (1st stat)?
When it's there check for the .pyc in the cache directory (2nd stat,
magic number encoded in filename), if it's not check for .pyc in the
source directory (2nd stat + read for magic number check).

Yes, although that would then incur higher stat overheads for
people distributing .pyc files. There doesn't seem to be a
way of pleasing everyone.

This is all assuming that the extra stat calls are actually
a problem. Does anyone have any evidence that they would
really take significant time compared to loading the module?
Once you've looked for one file in a given directory, looking
for another one in the same directory ought to be quite fast,
since all the relevant directory blocks will be in the
filesystem cache.

--
Greg
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to