You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Avoid a temporary float in PyFloat_AsDouble() for exact ints #162477
When a caller such as math.sqrt(42) asks for a C double, PyFloat_AsDouble() calls the integer's nb_float slot. That slot calls PyLong_AsDouble() and wraps the result in a Python float. The caller then reads the same double and releases the temporary float.
Activity
sergey-miryanov commentedon Nov 23, 2026
How will this change affect
performancebenchmarks?gh-162477: Add `PyLong_AsDouble()` fast-path for exact ints in `PyFlo…
vstinner commentedon Nov 23, 2026
I don't expect significant impact on pyperformance macro benchmarks. But IMO it's still worth it since it's faster on micro benchmarks.