Message158618
| Author |
pitrou |
| Recipients |
alanmcintyre, jcea, loewis, nadeem.vawda, pitrou, serhiy.storchaka |
| Date |
2012年04月18日.13:23:47 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1334755428.26.0.697893413736.issue14371@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> `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. |
|