[issue25401] Optimize bytes.fromhex() and bytearray.fromhex()

2015-10-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset 09e0533f3694 by Victor Stinner in branch 'default': Issue #25401: Remove now unused hex_digit_to_int() function https://hg.python.org/cpython/rev/09e0533f3694 -- ___ Python tracker

[issue25401] Optimize bytes.fromhex() and bytearray.fromhex()

2015-10-14 Thread STINNER Victor
Changes by STINNER Victor : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue25401] Optimize bytes.fromhex() and bytearray.fromhex()

2015-10-14 Thread STINNER Victor
STINNER Victor added the comment: It's between 2 and 3.5x faster. It's 9% slower on short string (10 bytes for the output), but I consider that the speedup is more interesting than the slowdown on short strings. RMicrobenchmark: Common platform: Platform: Linux-4.1.6-200.fc22.x86_64-x86_64-wi

[issue25401] Optimize bytes.fromhex() and bytearray.fromhex()

2015-10-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset 55d207a637ff by Victor Stinner in branch 'default': Optimize bytes.fromhex() and bytearray.fromhex() https://hg.python.org/cpython/rev/55d207a637ff -- nosy: +python-dev ___ Python tracker

[issue25401] Optimize bytes.fromhex() and bytearray.fromhex()

2015-10-14 Thread STINNER Victor
New submission from STINNER Victor: Attached patch optimizes bytes.fromhex() and bytearray.fromhex(): * Fast-path working on a char* string for ASCII string * Slow-path for non-ASCII string * Replace slow hex_digit_to_int() function with a O(1) lookup in _PyLong_DigitValue precomputed table * U