Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stream: reuse
maxBytesPerChunk
buffer for inflate / gunzip (#30239)
Before, for every round of `parse` a new buffer was allocated that was then copied again by `ByteString.fromArray`. This effectively more than doubled the allocation rate while inflating. For bulk data like expected for compressed data this can make a big difference in throughput. The slight downside of keeping the buffer is that the stage now uses more memory by default even while idle. deflate/gzip's window is 64kb which happens to be also the default `maxBytesPerChunk` setting. It is therefore expected that the additional buffer will less than double the existing memory footprint while dividing the allocation rate by more than two which seems like a good trade-off.
- Loading branch information