[issue14419] Faster ascii decoding

Serhiy Storchaka report at bugs.python.org
Tue Mar 27 15:42:55 CEST 2012


Serhiy Storchaka <storchaka at gmail.com> added the comment:

> New tests. I'm not conviced by the patch: it slows down the decoder for
> "short" strings. I don't understand which kind of ASCII encoded strings
> (specific length or content?) are optimized by the patch.

May be you forgot the -r? Add -r 100 or -r 1000 and run tests a few times to evaluate the dispersion.

I get the acceleration in all cases. For `bytes(range(128))*10` it barely exceeds variation (second patch is slightly faster than first one), for `bytes(range(128))*1000` it is 1.7x 
faster. For more short strings (under "short" I knew the length of the order of 10) measurement is thus quite impossible.

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.

----------

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


More information about the Python-bugs-list mailing list