[Python-Dev] Issue #11051: system calls per import

"Martin v. Löwis" martin at v.loewis.de
Mon Jan 31 23:45:12 CET 2011


> Another thing to consider: on App Engine (which despite of all its
> architectural weirdness uses a -- mostly -- standard Linux filesystem
> for the Python code of the app) someone measured that importing from a
> zipfile is much faster than importing from the filesystem. I would
> imagine this extends to other contexts too, and it makes sense because
> the zipfile directory gets cached in memory so no stat() calls are
> necessary.

Of course, you can't know until you measure, and then you only know
about the specific case.

However, I think you can't really compare zip reading with directory
reading - I'd expect that reading a zip directory is signficantly faster
than reading the directory contents of the zip file unpacked, just
because this is so many fewer layers of indirection.

Regards,
Martin


More information about the Python-Dev mailing list