Author Oren Milman
Recipients Oren Milman, mark.dickinson
Date 2016-09-26.10:19:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1474885188.59.0.846476882302.issue28272@psf.upfronthosting.co.za>
In-reply-to
Content
I looked at the assembly, and saw maybe_small_long is not inlined, but I agree that other compilers (or future compilers) might introduce some optimization that would elide the check.

Also, as expected (thanks to branch prediction, I guess), a little microbenchmark shows my patch doesn't improve performance:
without my patch:
    python.exe -m perf timeit "122 >> 2"
    ....................
    Median +- std dev: 20.5 ns +- 0.5 ns

    python.exe -m perf timeit "215 << 1"
    ....................
    Median +- std dev: 20.6 ns +- 0.5 ns
with my patch:
    python.exe -m perf timeit "122 >> 2"
    ....................
    Median +- std dev: 20.6 ns +- 0.3 ns

    python.exe -m perf timeit "215 << 1"
    ....................
    Median +- std dev: 20.6 ns +- 0.4 ns
History
Date User Action Args
2016-09-26 10:19:48Oren Milmansetrecipients: + Oren Milman, mark.dickinson
2016-09-26 10:19:48Oren Milmansetmessageid: <1474885188.59.0.846476882302.issue28272@psf.upfronthosting.co.za>
2016-09-26 10:19:48Oren Milmanlinkissue28272 messages
2016-09-26 10:19:48Oren Milmancreate