Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pyperformance/data-files/benchmarks/MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ chaos <local>
comprehensions <local>
crypto_pyaes <local>
dask <local>
decimal_factorial <local>
decimal_pi <local>
deepcopy <local>
deltablue <local>
django_template <local>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ dynamic = ["version"]
[tool.pyperformance]
name = "decimal_factorial"
tags = "decimal"
unsupported_implementations = ["pypy"] # pypy/pypy#5814
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- 2024-06-14: Michael Droettboom copied this from
Modules/_decimal/tests/bench.py in the CPython source and adapted to use
pyperf.
- 2026-09-26: Sergey B Kirpichev, use sys.set_int_max_str_digits(0).
"""

# Original copyright notice in CPython source:
Expand All @@ -15,6 +16,7 @@


import decimal
import sys


import pyperf
Expand All @@ -38,11 +40,12 @@ def bench_decimal_factorial():
c.Emin = decimal.MIN_EMIN

for n in [10000, 100000]:
# C version of decimal
_ = factorial(decimal.Decimal(n), 0)


if __name__ == "__main__":
sys.set_int_max_str_digits(0)

runner = pyperf.Runner()
runner.metadata["description"] = "decimal_factorial benchmark"

Expand Down
Loading