Uh oh!
There was an error while loading. Please reload this page.
Enable decimal benchmarks in the test suite (MANIFEST) - #453
Conversation
They were not added here in #341 for no reasons.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
cc @mdboom in case there was a reason to omit them. |
skirpichev
commented
Jan 20, 2026
Ah, pypy3 failure seems relevant. decimal_factorial looks too slow on PyPy3 (with only pure-Python version of the decimal module). |
Uh oh!
There was an error while loading. Please reload this page.
skirpichev
commented
Jan 28, 2026
@hugovk, anything else? I think we can enable decimal_factorial test, but this will need a workaround for pure-Python decimal module. The presence of accelerated module we can detect, trying to import the
|
Tested locally with modified Modules/_decimal/tests/bench.py: n = 1000 pydecimal: calculation time: 3.147357s conversion time: 0.000016s int: calculation time: 0.001096s conversion time: 0.000271s n = 5000 pydecimal: calculation time: 15.728110s conversion time: 0.000014s int: calculation time: 0.009037s conversion time: 0.006705s
Ok, adapted version of the factorial benchmark works with pure-Python module. Timings (from CI): 287 ms on CPython 3.14 vs 2.36 sec on PyPy. Edit: with the patch for python/cpython#140036 I got following on decimal_factorial benchmark with pure-Python class: So, probably we will have to adjust numbers anyway. |
skirpichev
commented
Apr 1, 2026
CC @vstinner |
vstinner
commented
May 4, 2026
Sorry, I'm not working on pyperformance anymore. It's uneasy for me to judge if this benchmark would be a good addition and it would measure correctly the big integer/decimal peerformance. |
skirpichev
commented
May 4, 2026
The problem is that there is no decimal benchmarks at all. |
They were not added here in #341 for no reasons.