From e0d3a8c1f4e52bb4a7d82f7f369b6796103740b3 Mon Sep 17 00:00:00 2001 From: Klaus Post Date: Fri, 23 Apr 2021 19:27:42 +0200 Subject: [PATCH] Alloc less for metacache decompression (#12134) Network streams are limited to 16K blocks. Don't alloc more upfront. Signed-off-by: Klaus Post --- cmd/metacache-stream.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/metacache-stream.go b/cmd/metacache-stream.go index f6a1fc17f..08a2f7375 100644 --- a/cmd/metacache-stream.go +++ b/cmd/metacache-stream.go @@ -230,7 +230,8 @@ func (w *metacacheWriter) Reset(out io.Writer) { } var s2DecPool = sync.Pool{New: func() interface{} { - return s2.NewReader(nil) + // Default alloc block for network transfer. + return s2.NewReader(nil, s2.ReaderAllocBlock(16<<10)) }} // metacacheReader allows reading a cache stream.