Message92876
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. ;-) |
|
Date |
User |
Action |
Args |
2009-09-19 20:36:23 | gawain | set | recipients:
+ gawain, collinwinter, gregory.p.smith, mark.dickinson, vstinner, eric.smith |
2009-09-19 20:36:22 | gawain | set | messageid: <1253392582.59.0.0284642146169.issue6713@psf.upfronthosting.co.za> |
2009-09-19 20:36:21 | gawain | link | issue6713 messages |
2009-09-19 20:36:20 | gawain | create | |
|