Gawain Bolton <gp.bol...@computer.org> added the comment: 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. ;-) ---------- Added file: http://bugs.python.org/file14935/int_decimal_conversion_trunk.patch2 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue6713> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com