[issue2377] Replace __import__ w/ importlib.__import__

Brett Cannon report at bugs.python.org
Fri Feb 24 19:29:27 CET 2012


Brett Cannon <brett at python.org> added the comment:

OK, I have now done as much C code as I'm going to do for the __import__() function. It has gotten bootstrapped importlib within 10% of normal_startup against default.

That leaves (possibly) rewriting BuiltinImporter in C and then just good old fashioned optimizations of the Python code.

I'm going to continue to use the normal_startup benchmark as my gold standard benchmark and importlib.test.benchmark just for iterative testing that a change made an impact (until there is another Python 3 benchmark that measures startup time using a real-world app). With that in mind and taking a PyPy style approach, that means I should focus on top-level, non-package imports first (28 of them), followed by builtins (14), submodules (4), packages (2), and then extensions (2). And if you don't want to do the math, there are 50 imports when starting Python, of which only 9 seem to follow (and include) site.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue2377>
_______________________________________


More information about the Python-bugs-list mailing list