New submission from Eli Bendersky <eli...@gmail.com>: >From this pydev thread: >http://mail.python.org/pipermail/python-dev/2012-July/120981.html
"BytesIO is actually missing an optimisation that is already used in StringIO: the StringIO C implementation uses a fragment accumulator internally, and collapses that into a single string object when getvalue() is called. BytesIO is still using the old "resize-the-buffer-as-you-go" strategy, and thus ends up repeatedly reallocating the buffer as the data sequence grows incrementally. It should be optimised to work the same way StringIO does (which is effectively the same way that the monkeypatched version works)" ---------- components: Library (Lib) messages: 165715 nosy: eli.bendersky, ncoghlan, pitrou priority: normal severity: normal stage: needs patch status: open title: Optimize BytesIO to so less reallocations when written, similarly to StringIO type: performance versions: Python 3.4 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue15381> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com