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 mark.dickinson
Recipients mark.dickinson, pitrou, serhiy.storchaka, vstinner, yselivanov
Date 2016-02-10.08:52:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1455094325.99.0.629434017775.issue26289@psf.upfronthosting.co.za>
In-reply-to
Content
A couple more observations:

1. I think you're missing the final multiplication by Py_SIZE(b) in the fast_mod code. Which is odd, because your tests should catch that. So either you didn't run the tests, or that code path isn't being used somehow.

2. Talking of tests, it would be good to have tests (for both // and %) for the case where the dividend is an exact multiple of the divisor.

3. Negative divisors almost never come up in real life, so you might also consider restricting the optimisations to the case Py_SIZE(b) == 1 (rather than ABS(Py_SIZE(b)) == 1). If that makes any speed difference at all for the case of positive divisors, then it's probably worth it. If not, then don't worry about it.
History
Date User Action Args
2016-02-10 08:52:06mark.dickinsonsetrecipients: + mark.dickinson, pitrou, vstinner, serhiy.storchaka, yselivanov
2016-02-10 08:52:05mark.dickinsonsetmessageid: <1455094325.99.0.629434017775.issue26289@psf.upfronthosting.co.za>
2016-02-10 08:52:05mark.dickinsonlinkissue26289 messages
2016-02-10 08:52:05mark.dickinsoncreate