[issue14478] Decimal hashing very slow, could be cached

James Hutchison report at bugs.python.org
Mon Apr 2 21:36:24 CEST 2012


James Hutchison <jamesghutchison at gmail.com> added the comment:

If I increase the cycles increased 10x with 3.2 I get:

int:  0.4219999313354492
Decimal:  24.20299983024597
CachingDecimal:  1.7809998989105225

The sample you have provided is basically what I'm using. See attached

What about worst case hash calculation time for Decimal? How does the C code handle that? This is if I increase the values themselves by 100x, same number of loops as above

int:  0.5309998989105225
CachingDecimal:  2.078000068664551
Decimal:  41.2979998588562

----------
Added file: http://bugs.python.org/file25100/cachedDecimal.py

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


More information about the Python-bugs-list mailing list