Matt Mackall <mpm@selenic.com> [Fri, 06 Aug 2010 12:18:33 -0500] rev 11758
chunkbuffer: use += rather than cStringIO to reduce memory footprint
This significantly refactors the read() loop to use a queue of chunks.
The queue is alternately filled to at least 256k and then emptied by
concatenating onto the output buffer.
For very large read sizes, += uses less memory because it can resize
the target string in place.