[issue14419] Faster ascii decoding

Antoine Pitrou report at bugs.python.org
Tue Mar 27 15:57:50 CEST 2012


Antoine Pitrou <pitrou at free.fr> added the comment:

> This may also depend on the processor and compiler. I have AMD Athlon
> 64 X2 4600+ (2-core, 2.4GHz, 512 KB cache) and use gcc 4.4.3 on 32-bit 
> Linux.

Then by choosing a string length that exceeds the L2 cache size, you may have found an ideal case for your optimization. Basically you're doing the error checking and the memcpy in one single pass.

Honestly I'm not sure that's worth the hassle. ASCII-decoding is already very fast for shorter strings.

(no need to pass "-n" or "-r" to timeit, it will figure out adequate numbers by itself)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14419>
_______________________________________


More information about the Python-bugs-list mailing list