Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pythongh-111139: Optimize math.gcd(int, int)
Add a fast-path for the common case. Benchmark: python -m pyperf timeit \ -s 'import math; gcd=math.gcd; x=2*3; y=3*5' \ 'gcd(x,y)' Result: 1.07x faster (-3.4 ns) Mean +- std dev: 52.6 ns +- 4.0 ns -> 49.2 ns +- 0.4 ns: 1.07x faster
- Loading branch information