From 41b0b951f37353b17a632735c8aa3406ad6f4b69 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Thu, 12 Jan 2023 01:29:42 -0800 Subject: [PATCH] app/vmselect/netstorage: unpack series blocks in the current goroutine if their count doesnt exceed 100 This should improve performance a bit for common case --- app/vmselect/netstorage/netstorage.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/vmselect/netstorage/netstorage.go b/app/vmselect/netstorage/netstorage.go index 037d6b4e1f..cccf659d66 100644 --- a/app/vmselect/netstorage/netstorage.go +++ b/app/vmselect/netstorage/netstorage.go @@ -485,7 +485,7 @@ func (pts *packedTimeseries) unpackTo(dst []*sortBlock, tbfs []*tmpBlocksFile, t upw.addr = addr upw.tr = tr } - if gomaxprocs == 1 || upwsLen == 1 { + if gomaxprocs == 1 || upwsLen <= 100 { // It is faster to unpack all the data in the current goroutine. upw := getUnpackWork() samples := 0