[Import-sig] Re: [Python-Dev] Re: Proposal for a modified import mechanism.

James C. Ahlstrom jim@interet.com
Mon, 12 Nov 2001 10:02:59 -0500


eric wrote:

> (and see) 0% overhead for importing standard modules (by far the most
> common case).  Adding 10% overhead to importing a very large package
> with 10-15 nested sub-packages is just not a big deal.  The 350% cost I
> saw (noted in a response to Gordon) is a *huge* deal and would need to be
> solved (moving to C would help) before this became standard.

I have code which caches directory contents, and related benchmarks.
This might help, and could be combined with a new Python module
for importing packages, say, as a new method "importer" in __init__.py.
Please see python-dev, "Caching directory files in import.c".

JimA