[issue32147] improve performance of binascii.unhexlify() by using conversion table

Meador Inge report at bugs.python.org
Sun Dec 17 15:19:31 EST 2017


Meador Inge <meadori at gmail.com> added the comment:

FWIW, I see a win on OS X 10.12.6:

λ:[master !?](~/Code/src/python/cpython)=> cc --version
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
λ:[master !?](~/Code/src/python/cpython)=> uname -a
Darwin ripley.attlocal.net 16.7.0 Darwin Kernel Version 16.7.0: Wed Oct  4 00:17:00 PDT 2017; root:xnu-3789.71.6~1/RELEASE_X86_64 x86_64

- Before:
λ:[master ?](~/Code/src/python/cpython)=> ./python.exe -m timeit -s "from binascii import unhexlify; b = b'aa'*2**20" "unhexlify(b)"
20 loops, best of 5: 11.3 msec per loop

- After:
λ:[master !?](~/Code/src/python/cpython)=> ./python.exe -m timeit -s "from binascii import unhexlify; b = b'aa'*2**20" "unhexlify(b)"
50 loops, best of 5: 4.15 msec per loop

----------
nosy: +meador.inge

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32147>
_______________________________________


More information about the Python-bugs-list mailing list