This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients alanmcintyre, jcea, loewis, nadeem.vawda, pitrou, serhiy.storchaka
Date 2012-04-19.20:25:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1334849531.4162.16.camel@raxxla>
In-reply-to <1334755428.26.0.697893413736.issue14371@psf.upfronthosting.co.za>
Content
> Perhaps because your system's memory allocator is extremely good (or buf is always very small), but b''.join() is far more robust.
> Another alternative is accumulating in a bytearray, since it uses overallocation for linear time appending.

I thought, that it was in special optimization, mentioned in the
python-dev, but could not find this in the code. Perhaps it had not been
implemented.

In this particular case, the bytes appending is performed only once (and
probably a lot of appending with b''). Exceptions are possible only in
pathological cases, for example when compressed data is much larger
uncompressed data. The current implementation uses `buf += data`, if
someone wants to change it, then it's not me.
History
Date User Action Args
2012-04-19 20:25:47serhiy.storchakasetrecipients: + serhiy.storchaka, loewis, jcea, alanmcintyre, pitrou, nadeem.vawda
2012-04-19 20:25:46serhiy.storchakalinkissue14371 messages
2012-04-19 20:25:46serhiy.storchakacreate