New submission from Antoine Pitrou <pit...@free.fr>:

io.StringIO is quite slower than ''.append() when used for mass concatenation 
(around 5x slower). This patch brings it to similar performance by deferring 
construction of the internal buffer until needed.

The problem is that it's very easy to disable the optimization by calling a 
method other than write() and getvalue().

----------
components: IO
files: stringio.patch
keywords: patch
messages: 145322
nosy: haypo, pitrou
priority: normal
severity: normal
status: open
title: optimization for append-only StringIO
type: performance
versions: Python 3.3
Added file: http://bugs.python.org/file23373/stringio.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13149>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to