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.

Author serhiy.storchaka
Recipients brett.cannon, eric.smith, eric.snow, ncoghlan, pitrou, serhiy.storchaka
Date 2014-10-05.14:57:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <9949849.oyC1NFgk3B@raxxla>
In-reply-to <3302796.27zqVUnYJV@raxxla>
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
History
Date User Action Args
2014-10-05 14:57:17serhiy.storchakasetrecipients: + serhiy.storchaka, brett.cannon, ncoghlan, pitrou, eric.smith, eric.snow
2014-10-05 14:57:17serhiy.storchakalinkissue22557 messages
2014-10-05 14:57:17serhiy.storchakacreate