[issue14478] Decimal hashing very slow, could be cached

Stefan Krah report at bugs.python.org
Tue Apr 10 16:35:01 CEST 2012


Stefan Krah <stefan-usenet at bytereef.org> added the comment:

I changed the C version to cache the hash as well: For the submitted
test case the speedup is only 5x, but hashing times vary greatly
depending of the size of the coefficient and the exponent.


BTW, the tests already call both hash() and __hash__() on the same
number, so retrieving the cached value is actually tested.

----------

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


More information about the Python-bugs-list mailing list