[issue17628] str==str: compare the first and last character before calling memcmp()

STINNER Victor report at bugs.python.org
Wed Apr 10 00:13:49 CEST 2013


STINNER Victor added the comment:

Because most people agree that checking first and/or last byte/character is not a good idea (may be slower), here is a new patch removing code checking first/last byte or character in bytes_richcompare() and unicode_eq().

It removes the usage of the "register" keyword, I read that modern compilers generate worse code when this keyword is used. Register allocators of modern compilers known better than you which variables should use a register.

----------
Added file: http://bugs.python.org/file29757/dont_compare_first_last.patch

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


More information about the Python-bugs-list mailing list