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 tim.peters
Recipients PedanticHacker, Stefan Pochmann, mark.dickinson, mcognetta, rhettinger, serhiy.storchaka, tim.peters
Date 2021-12-30.17:59:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1640887193.18.0.89863868837.issue37295@roundup.psfhosted.org>
In-reply-to
Content
> Aargh! That is of course what I meant, but not in fact
> what I timed. :-(

!!! Even more baffling then. Seems like the code posted got out of math_comb_impl() early here:

        if (overflow || ki > ni) {
            result = PyLong_FromLong(0);
            goto done;
        }

67 out of every 68 times comb() was called, before any actual ;-) computation was even tried. Yet one way was significantly faster than the other overall, despite that they were so rarely executed at all?

Something ... seems off here ;-)
History
Date User Action Args
2021-12-30 17:59:53tim.peterssetrecipients: + tim.peters, rhettinger, mark.dickinson, serhiy.storchaka, PedanticHacker, mcognetta, Stefan Pochmann
2021-12-30 17:59:53tim.peterssetmessageid: <1640887193.18.0.89863868837.issue37295@roundup.psfhosted.org>
2021-12-30 17:59:53tim.peterslinkissue37295 messages
2021-12-30 17:59:53tim.peterscreate