What version of Go are you using (go version)?
$ go version
go version go1.20.3 linux/amd64
Does this issue reproduce with the latest release?
Yes
What did you do? What did you see instead?
I noticed large memory allocations reading a flate-endoded zip archive with many files. Looks like opening each file 4KB buffer is allocated (if I read the files sequentially it is not needed - GC does a lot of work). So if I open a zip archive with 50000 files the memory allocations will be about 200 MB in sum just for the buffers.
See the test in the prepared PR for a code example.
What did you expect to see?
Less memory allocations.
What version of Go are you using (
go version)?Does this issue reproduce with the latest release?
Yes
What did you do? What did you see instead?
I noticed large memory allocations reading a flate-endoded zip archive with many files. Looks like opening each file 4KB buffer is allocated (if I read the files sequentially it is not needed - GC does a lot of work). So if I open a zip archive with 50000 files the memory allocations will be about 200 MB in sum just for the buffers.
See the test in the prepared PR for a code example.
What did you expect to see?
Less memory allocations.