Author mark.dickinson
Recipients Oren Milman, mark.dickinson, serhiy.storchaka, vstinner
Date 2016-09-17.18:42:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1474137746.9.0.99768088106.issue27441@psf.upfronthosting.co.za>
In-reply-to
Content
> Am I missing anything that might cause my patches to introduce a performance penalty?

It's at least conceivable that code like

   Py_SIZE(v) = negative ? -ndigits : ndigits;

might be compiled to something branchless on some platforms (with some sets of compiler flags). The assembly you show demonstrates that that doesn't happen on your machine, but that doesn't say anything about other current or future machines.

I also prefer the original form for readability; so I agree with Serhiy that we shouldn't change it without evidence that the change improves performance.

I'll remove the two obviously redundant `Py_SIZE(v) = ...` operations in PyLong_FromUnsignedLong and PyLong_FromUnsignedLongLong.
History
Date User Action Args
2016-09-17 18:42:26mark.dickinsonsetrecipients: + mark.dickinson, vstinner, serhiy.storchaka, Oren Milman
2016-09-17 18:42:26mark.dickinsonsetmessageid: <1474137746.9.0.99768088106.issue27441@psf.upfronthosting.co.za>
2016-09-17 18:42:26mark.dickinsonlinkissue27441 messages
2016-09-17 18:42:26mark.dickinsoncreate