commit | 4574e62c6e0f52369a67ffae0984004f9aac2ba5 | [log] [tgz] |
---|---|---|
author | Antoine Pitrou <solipsis@pitrou.net> | Fri Oct 07 02:26:47 2011 +0200 |
committer | Antoine Pitrou <solipsis@pitrou.net> | Fri Oct 07 02:26:47 2011 +0200 |
tree | e749723496031a66fe2749149dd2f29b3f40a9ec | |
parent | 5c0ba36d5ff8d7693c5014b8696e2fab7468afd4 [diff] |
Fix massive slowdown in string formatting with str.format. Example: ./python -m timeit -s "f='{}' + '-' * 1024 + '{}'; s='abcd' * 16384" "f.format(s, s)" -> before: 547 usec per loop -> after: 13 usec per loop -> 3.2: 22.5 usec per loop -> 2.7: 12.6 usec per loop