Antoine Pitrou <[email protected]> added the comment: > `buf += data` is noticeably faster `b''.join()` in CPython.
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. ---------- nosy: +pitrou _______________________________________ Python tracker <[email protected]> <http://bugs.python.org/issue14371> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
