Skip to content

Commit

Permalink
remove reallocs and overallocs for s.lset in bucket.go (#1718)
Browse files Browse the repository at this point in the history
- append to s.lset caused reallocs and overallocs
- this is now fixed by properly setting capacity on s.lset
- pprof shows "-316.22MB, 5.00% of 6322.82MB total" for sample data set and query I used

Signed-off-by: Philip Panyukov <ppanyukov@googlemail.com>
  • Loading branch information
ppanyukov authored and bwplotka committed Nov 5, 2019
1 parent 5d936e2 commit f501429
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/store/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ func blockSeries(
return nil, nil, errors.Wrap(err, "read series")
}
s := seriesEntry{
lset: make([]storepb.Label, 0, len(lset)),
lset: make([]storepb.Label, 0, len(lset)+len(extLset)),
refs: make([]uint64, 0, len(chks)),
chks: make([]storepb.AggrChunk, 0, len(chks)),
}
Expand Down

0 comments on commit f501429

Please sign in to comment.