[issue15612] Rewriter StringIO to use the _PyUnicodeWriter API

2012-08-09 Thread STINNER Victor
Changes by STINNER Victor : -- type: -> performance ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue15612] Rewriter StringIO to use the _PyUnicodeWriter API

2012-08-09 Thread STINNER Victor
STINNER Victor added the comment: Results of my micro benchmark. Use attached bench_stringio.py with benchmark.py: https://bitbucket.org/haypo/misc/src/tip/python/benchmark.py Command: ./python benchmark.py script bench_stringio.py Common platform: CPU model: Intel(R) Core(TM) i7-2600 CPU

[issue15612] Rewriter StringIO to use the _PyUnicodeWriter API

2012-08-09 Thread STINNER Victor
New submission from STINNER Victor: Attached patch rewrites the C implementation of StringIO to use the _PyUnicodeWriter API instead of the PyAccu API. It provides better performance when writing non-ASCII strings. The patch adds new functions: - _PyUnicodeWriter_Truncate() - _PyUnicodeWrit