Message 228573 - Python tracker

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Content
Second version of the patch uses fast patch only when builtin __import__ is 
not overridden. It is slightly slower (due to lookup of __import__).

>>> import timeit
>>> def f():
...     import locale
... 
>>> min(timeit.repeat(f, number=100000, repeat=10))
0.10502300000371179

The code is simpler, but still some cumbersome. It would be good to optimize 
also "from locale import getlocale".
Files
File name Uploaded
faster_import_2.patch serhiy.storchaka, 2014-10-05.14:57:17