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

Greg Ewing greg.ewing at canterbury.ac.nz
Sun Jan 30 22:23:45 CET 2011

Victor Stinner wrote:

> Limit the number of suffixes is maybe not the right solution to limit
> the number of system calls at startup. We can imagine alternatives:
>  * remember the last filename when loading a module and retry this
> filename first
>  * specify that a module is a Python system module and should only be
> loaded from "system directories"
>  * specify the module type (directory, .py file, dynamic library, ...)
> when loading a module
>  * (or a least remember the module type and retry this type first)
>  * etc.

Maybe also

    * Read and cache the directory contents and search it ourselves
      instead of making a system call for every possible name.


More information about the Python-Dev mailing list