[issue29410] Moving to SipHash-1-3

Christian Heimes report at bugs.python.org
Sat Oct 9 12:31:49 EDT 2021


Christian Heimes <lists at cheimes.de> added the comment:

> But do they use them as dict keys? AFAIK strings aren't hashed until hash() is called on them.

That's correct. The hash of str and bytes is calculated on demand and then cached.

Frozensets also cache their hash values while tuples don't have a cache. We ran experiments with hash caching in tuples many years ago. It turned out that the increased size had an overall negative effect on performance. This may have changed with modern hardware with more RAM and much larger CPU caches, though.

----------

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


More information about the Python-bugs-list mailing list