[issue14621] Hash function is not randomized properly

Christian Heimes report at bugs.python.org
Wed Nov 7 01:52:08 CET 2012


Christian Heimes added the comment:

Thanks to Snakebit I was able to tests the code on a 32bit BSD installation with GCC 4.2. The ASCII unicode and bytes performance is about 8% slower, UCS2 unicode is about 37% slower. There might be room for improvements, though.

% ./python -m timeit -r20 -n1000000 -s "h = hash; x = 'a' * 10**7" -- "h(x)"
Current:
1000000 loops, best of 20: 0.109 usec per loop
SipHash:
1000000 loops, best of 20: 0.118 usec per loop

% ./python -m timeit -r20 -n1000000 -s "h = hash; x = 'ä' * 10**7" -- "h(x)"
Current:
1000000 loops, best of 20: 0.119 usec per loop
SipHash:
1000000 loops, best of 20: 0.163 usec per loop

----------

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


More information about the Python-bugs-list mailing list