Browse Source

tsdb: re-use iterator when stepping through chunks

Saves memory allocations, hence reduces garbage-collection overheads.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
pull/11761/head
Bryan Boreham 2 years ago
parent
commit
1848623c77
  1. 2
      tsdb/querier.go

2
tsdb/querier.go

@ -682,7 +682,7 @@ func (p *populateWithDelSeriesIterator) Next() chunkenc.ValueType {
if p.currDelIter != nil {
p.curr = p.currDelIter
} else {
p.curr = p.currChkMeta.Chunk.Iterator(nil)
p.curr = p.currChkMeta.Chunk.Iterator(p.curr)
}
if valueType := p.curr.Next(); valueType != chunkenc.ValNone {
return valueType

Loading…
Cancel
Save