[issue14687] Optimize str%tuple for the PEP 393

STINNER Victor report at bugs.python.org
Thu May 3 13:12:19 CEST 2012


STINNER Victor <victor.stinner at gmail.com> added the comment:

Results on 32 bits (Intel Core i5 CPU 661 @ 3.33GHz) on Linux 3.0 with a new patch.

Python 3.2:
 
10000000 loops, best of 3: 0.133 usec per loop
100000 loops, best of 3: 4.64 usec per loop
1000000 loops, best of 3: 0.637 usec per loop
1000000 loops, best of 3: 0.364 usec per loop

Python 3.3 @ 1439e2d1f490 (before my first optimization on str%tuple):

10000000 loops, best of 3: 0.193 usec per loop
100000 loops, best of 3: 10.1 usec per loop
1000000 loops, best of 3: 0.838 usec per loop
1000000 loops, best of 3: 0.825 usec per loop

Python 3.3 + patch, overallocate 50%:

10000000 loops, best of 3: 0.15 usec per loop
100000 loops, best of 3: 8.27 usec per loop
1000000 loops, best of 3: 0.527 usec per loop
1000000 loops, best of 3: 0.566 usec per loop

Python 3.3 + patch, overallocate 25%:

10000000 loops, best of 3: 0.142 usec per loop
100000 loops, best of 3: 7.93 usec per loop
1000000 loops, best of 3: 0.532 usec per loop
1000000 loops, best of 3: 0.546 usec per loop

I'm going to commit the new patch with an overallocation of 25%.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14687>
_______________________________________


More information about the Python-bugs-list mailing list