[Python-Dev] Importing .pyc in -O mode and vice versa
Brett Cannon
brett at python.org
Sun Nov 5 08:28:59 CET 2006
On 11/4/06, Jean-Paul Calderone <exarkun at divmod.com> wrote:
>
> On Sun, 05 Nov 2006 14:21:34 +1300, Greg Ewing <
> greg.ewing at canterbury.ac.nz> wrote:
> >Fredrik Lundh wrote:
> >
> >> well, from a performance perspective, it would be nice if Python looked
> >> for *fewer* things, not more things.
> >
> >Instead of searching for things by doing a stat call
> >for each possible file name, would it perhaps be
> >faster to read the contents of all the directories
> >along sys.path into memory and then go searching
> >through that?
>
> Bad for large directories. There's a cross-over at some number
> of entries. Maybe Python should have a runtime-tuned heuristic
> for selecting a filesystem traversal mechanism.
Hopefully my import rewrite is flexible enough that people will be able to
plug in their own importer/loader for the filesystem so that they can tune
how things like this are handled (e.g., caching what files are in a
directory, skipping bytecode files, etc.).
-Brett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-dev/attachments/20061104/7a45ac89/attachment.html
More information about the Python-Dev
mailing list