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
Date 2016-10-11.11:05:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1476183920.16.0.49801706523.issue28397@psf.upfronthosting.co.za>
In-reply-to
Content
In the following program, with gcc-5.3 doit() is significantly faster than doit2() in 64-bit Linux:

================================================================
#include <stdint.h>

int
doit(int64_t index, int64_t nitems)
{
    return index < 0 || index >= nitems;
}

int
doit2(int64_t index, int64_t nitems)
{
    return (uint64_t)index >= (uint64_t)nitems;
}

int
main(void)
{
    int count, i;

    for (i = 0; i < 1000000000; i++) {
        count += doit(832921, i);
    }

    return count;
}
================================================================
History
Date User Action Args
2016-10-11 11:05:20skrahsetrecipients: + skrah, rhettinger, serhiy.storchaka
2016-10-11 11:05:20skrahsetmessageid: <1476183920.16.0.49801706523.issue28397@psf.upfronthosting.co.za>
2016-10-11 11:05:20skrahlinkissue28397 messages
2016-10-11 11:05:20skrahcreate