11 Oct
2013
11 Oct
'13
7:24 a.m.
Hi, recently there has been some talk about reducing import times. It seems that the current import strategy for C extensions (i.e. importing the extension at the bottom of the .py file) is quite slow: ==================== import sys for i in range(10000): import decimal del sys.modules('decimal') del sys.modules('_decimal') ==================== With the regular decimal.py the script is about 9 times slower than running it with a modified decimal.py that just contains "from _decimal import *". I don't know enough about the import mechanism to say whether this is a particularly good benchmark. If it is, perhaps we should devise another strategy for loading C extensions. Stefan Krah
3819
Age (days ago)
3822
Last active (days ago)
24 comments
10 participants
participants (10)
-
Antoine Pitrou
-
Brett Cannon
-
Christian Heimes
-
Eric Snow
-
Nick Coghlan
-
Oscar Benjamin
-
R. David Murray
-
Stefan Behnel
-
Stefan Krah
-
Victor Stinner