[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

Steffen Daode Nurpmeso report at bugs.python.org
Fri Feb 25 13:38:45 CET 2011


Steffen Daode Nurpmeso <sdaoden at googlemail.com> added the comment:

(Not issue related)
Ezio and Alexander: after reading your posts and looking back on my code: you're absolutely right.  Doing resize(31) is pointless: it doesn't save space (mempool serves [8],16,24,32 there; and: dynamic, normalized coded names don't exist that long in real life, too).  And append_char() is inlined but much more expensive than doing (register-loaded) *(target++)=char.  Thus i now do believe my code is a bug and i will rewrite doing *target=cstr(resize(len(input)*2)) ... truncate() instead!
Thanks.

----------

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


More information about the Python-bugs-list mailing list