Dev Tools · 1h ago
CPython's 4300-digit limit silently broke benchmarks for a year
A developer discovered that CPython's default 4300-digit integer-to-string conversion limit caused his multi-language benchmark suite to produce N/A results for Python at N≥24 for over a year. The bug, triggered by stringifying a 6002-digit Mersenne prime, was fixed by removing the unnecessary str() call. After the fix, Python's performance was measured at 2425.9 ms, revealing previously hidden data.
Meridian48 take
This is a cautionary tale about default safety limits silently corrupting data, but the real story is how easy it is to miss such bugs when benchmarks lack proper regression testing.
Read the full reporting
My benchmark's Python column was N/A for a year — CPython's 4300-digit limit, and eight other bugs →
DEV Community
cpythonbenchmarking