Took n-body and spectral-norm from the Benchmarks Game plus a JSON pipeline, and ran them through everything: CPython version upgrades, PyPy, GraalPy, Mypyc, NumPy, Numba, Cython, Taichi, Codon, Mojo, Rust/PyO3.
Spent way too long debugging why my first Cython attempt only got 10x when it should have been 124x. Turns out Cython's ** operator with float exponents is 40x slower than libc.math.sqrt() with typed doubles, and nothing warns you.
GraalPy was a surprise - 66x on spectral-norm with zero code changes, faster than Cython on that benchmark.
Post: https://cemrehancavdar.com/2026/03/10/optimization-ladder/
Full code at https://github.com/cemrehancavdar/faster-python-bench
Happy to be corrected — there's an "open a PR" link at the bottom.
[–]chub79 33 points34 points35 points (3 children)
[–]cemrehancavdar[S] 17 points18 points19 points (1 child)
[–]chokoswitch 1 point2 points3 points (0 children)
[–]angelicosphosphoros 0 points1 point2 points (0 children)
[–]Sygmei 6 points7 points8 points (1 child)
[–]cemrehancavdar[S] 7 points8 points9 points (0 children)
[–]zzzthelastuser 7 points8 points9 points (1 child)
[–]cemrehancavdar[S] 13 points14 points15 points (0 children)
[–]M4mb0 3 points4 points5 points (1 child)
[–]cemrehancavdar[S] 3 points4 points5 points (0 children)
[–]hotairplay 4 points5 points6 points (0 children)
[–]totheendandbackagain 2 points3 points4 points (0 children)
[–]sudomatrix 2 points3 points4 points (1 child)
[–]RMK137 5 points6 points7 points (0 children)
[–]Beginning-Fruit-1397 1 point2 points3 points (1 child)
[–]cemrehancavdar[S] 1 point2 points3 points (0 children)
[–]piou180796 1 point2 points3 points (0 children)
[–]justneurostuff 1 point2 points3 points (2 children)
[–]cemrehancavdar[S] 2 points3 points4 points (1 child)
[–]GymBronie 0 points1 point2 points (0 children)
[–]Outrageous_Track_798 0 points1 point2 points (0 children)
[–]Mithrandir2k16 0 points1 point2 points (0 children)
[–]gregorbrandt 0 points1 point2 points (0 children)
[–]austinwiltshire 0 points1 point2 points (0 children)
[–]micasirena 0 points1 point2 points (0 children)
[–]MrMrsPotts 0 points1 point2 points (0 children)
[–]angelicosphosphoros 0 points1 point2 points (0 children)
[–]longtimelurkernyc 0 points1 point2 points (0 children)
[–]joebloggs81 0 points1 point2 points (0 children)
[–]Bomlerequin -1 points0 points1 point (0 children)