[Python-Dev] C extension import time
Antoine Pitrou
solipsis at pitrou.net
Fri Oct 11 17:20:34 CEST 2013
Le Fri, 11 Oct 2013 17:01:35 +0200,
Stefan Krah <stefan at bytereef.org> a écrit :
>
> I'm getting about the same values as above. I may be misunderstanding
> something, but I wanted to reduce the difference between the 2.21 msec
> and the 112 usec.
So you aren't complaining about C extension import time, but Python
code import time, right?
> So the first step I tried is something horrible (typing from memory):
>
> try:
> import _decimal
> except ImportError:
> <whole of decimal.py here !!!>
> else:
> from _decimal import *
>
> That way the 2.21 msec are reduced to 912 usec, but the indentation is
> an abomination.
Just create a _pydecimal module (like _pyio).
Regards
Antoine.
More information about the Python-Dev
mailing list