Adam Olsen <rha...@gmail.com> added the comment:

Antoine, x ^= x>>4 has a higher collision rate than just a rotate. 
However, it's still lower than a statistically random hash.

If you modify the benchmark to randomly discard 90% of its contents this
should give you random addresses, reflecting a long-running program.

Here's the results I got (I used shift, too lazy to rotate):
XOR, sequential:      20.174627065692999
XOR, random:          30.460708379770004
shift, sequential:    19.148091554626003
shift, random:        30.495631933229998
original, sequential: 23.736469268799997
original, random:     33.536177158379999

Not massive, but still worth fixing the hash.

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5186>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to