-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve performance of binascii.unhexlify() by using conversion table #76328
Comments
Before: $ ./python -m timeit -s "from binascii import unhexlify; b = b'aa'*2**20" "unhexlify(b)"
50 loops, best of 5: 5.68 msec per loop After: $ ./python -m timeit -s "from binascii import unhexlify; b = b'aa'*2**20" "unhexlify(b)"
100 loops, best of 5: 2.06 msec per loop |
I can't reproduce the performance difference. |
Serhiy, did you use the same benchmark as mentioned here? |
Yes. And I can't reproduce a slowdown with a simplified a2b_qp(). Maybe this depends on the compiler and on the CPU. What are your OS, compiler and CPU? Do you build 32- or 64-bit Python? Do you build in a debug or release mode? |
|
Here are the results here:
|
(platform is Ubuntu 16.04, 64-bit, on a Core i5-2500K CPU) |
Is there anything I can do to push this forward? BTW, Serhiy, what are your OS, compiler and CPU? |
FWIW, I see a win on OS X 10.12.6: λ:master !?=> cc --version
|
Since this PR was merged, can the issue be closed? |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: