[issue14621] Hash function is not randomized properly

Giovanni Bajo report at bugs.python.org
Wed Jan 2 11:15:43 CET 2013


Giovanni Bajo added the comment:

Il giorno 02/gen/2013, alle ore 06:52, Christian Heimes <report at bugs.python.org> ha scritto:

> 
> Christian Heimes added the comment:
> 
> Thanks for the information! I'm working on a PEP for the issue at hand.

Since you're collecting ideas on this, I would like to stress that, in the Python 3 transition, it was deemed acceptable to switch all objects to use unicode strings for attribute names, making the hash computation of such attributes (in the context of the instance dictionary) at least twice as slow than it used to be (the 'at least' refers to the fact that longer strings might have even worse effects because of a higher number of cache misses). SipHash isn't twice as slow as the current hash function, not even for short strings.

So there is a precedent in slowing down the hash computation time in a very important use case, and it doesn't look like hell froze over.
-- 
Giovanni Bajo

----------

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


More information about the Python-bugs-list mailing list