STINNER Victor <victor.stin...@gmail.com> added the comment: 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) ---------- Added file: http://bugs.python.org/file25691/faster-format.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue14744> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com