A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2013-October/129388.html below:

[Python-Dev] C extension import time

[Python-Dev] C extension import time [Python-Dev] C extension import timeStefan Krah stefan at bytereef.org
Fri Oct 11 14:24:29 CEST 2013
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 



More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4