Message 259560 - Python tracker
I prefer fastint_alt.patch design, it's simpler. I added a comment on the review. My numbers, best of 5 timeit runs: $ ./python -m timeit -s "x = 12345" -- "x*2; x*2; x*2; x*2; x*2; x*2; x*2; x*2; x*2; x*2; " * original: 299 ns * fastint2.patch: 282 ns (-17 ns, -6%) * fastint_alt.patch: 267 ns (-32 ns, -11%)