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 gawain
Recipients collinwinter, eric.smith, gawain, gregory.p.smith, mark.dickinson, vstinner
Date 2009-09-19.20:36:20
SpamBayes Score 2.7588876e-11
Marked as misclassified No
Message-id <1253392582.59.0.0284642146169.issue6713@psf.upfronthosting.co.za>
In-reply-to
Content
Here's a modified version of the patch to Objects/intobject.c which
__does__ use the two-digits-at-a-time optimization.

Compared to the int_decimal_conversion_trunk.patch, my tests show a
further 12.5% improvement with two digit numbers - positive or negative
and more than 8% overall using different sizes all the way up to sys.maxint.

I admit, there is a slight increase in code complexity.  However, I
disagree that the optimization is machine/compiler dependent as there
are fundamentally half as many divisions.

I hope I don't come across as unappreciative, on the contrary the
fundamental ideas is to special case base 10 conversions and get a speed
boost by leveraging the compiler and the
int_decimal_conversion_trunk.patch does this nicely.

I do think it would be unfortunately to not go a little further though -
just because we can do better with little effort, we can save a few CPU
cycles which means saving time, money and all of this can only be good
for the planet.  ;-)
History
Date User Action Args
2009-09-19 20:36:23gawainsetrecipients: + gawain, collinwinter, gregory.p.smith, mark.dickinson, vstinner, eric.smith
2009-09-19 20:36:22gawainsetmessageid: <1253392582.59.0.0284642146169.issue6713@psf.upfronthosting.co.za>
2009-09-19 20:36:21gawainlinkissue6713 messages
2009-09-19 20:36:20gawaincreate