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 <>
> 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.
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: <>
2016-09-17 18:42:26mark.dickinsonlinkissue27441 messages
2016-09-17 18:42:26mark.dickinsoncreate