This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author skrah
Recipients rhettinger, serhiy.storchaka, skrah, socketpair
Date 2016-10-11.13:30:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1476192658.67.0.289705422722.issue28397@psf.upfronthosting.co.za>
In-reply-to
Content
On 64-bit Linux there's no difference:

$ ./usr/bin/gcc -O3 -o issue28397-2 issue28397-2.c
$  time ./issue28397-2 0

real    0m2.486s
user    0m2.424s
sys     0m0.014s
$ time ./issue28397-2 1

real    0m2.433s
user    0m2.422s
sys     0m0.008s



Also, most of the time "index < 0 || index >= nitems" *is* inlined,
and it was at least three times faster here.


I guess the general point is that such micro-optimizations are
unpredictable on modern architectures and modern compilers.

Note that the fast inlined version used SSE instructions.
History
Date User Action Args
2016-10-11 13:30:58skrahsetrecipients: + skrah, rhettinger, socketpair, serhiy.storchaka
2016-10-11 13:30:58skrahsetmessageid: <1476192658.67.0.289705422722.issue28397@psf.upfronthosting.co.za>
2016-10-11 13:30:58skrahlinkissue28397 messages
2016-10-11 13:30:58skrahcreate