Message161464
| Author |
vstinner |
| Recipients |
loewis, mark.dickinson, pitrou, python-dev, serhiy.storchaka, vstinner |
| Date |
2012年05月23日.21:50:46 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1337809848.96.0.817790889027.issue14744@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
faster-format.patch: Patch for Python 3.3 optimizing str%args and str.format(args), use _PyUnicodeWriter deeper in formatting. The patch uses different optimizations:
* if the result is just a string, copy the string by reference, don't copy it by value. It's not something new, this optimization was already used by the PyAccu API. Examples:
- "{}".format(str)
- "%s".format(str)
* avoid a temporary buffer to format integers (base 2, 8, 10, 16). Examples:
- "decimal=%s".format(int)
- "hex=%x".format(int)
- "%o".format(int)
- "{}".format(int)
- "{:x}".format(int)
* don't overallocate the last argument of a format string. Example:
- "x=%s".format("A" * 4096) |
|