We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7d13c2f + a2ec191 commit d601f0aCopy full SHA for d601f0a
pkg/chunk/encoding/bigchunk.go
@@ -65,6 +65,12 @@ func (b *bigchunk) addNextChunk(start model.Time) error {
65
}
66
67
68
+ // Explicitly reallocate slice to avoid up to 2x overhead if we let append() do it
69
+ if len(b.chunks)+1 > cap(b.chunks) {
70
+ newChunks := make([]smallChunk, len(b.chunks), len(b.chunks)+1)
71
+ copy(newChunks, b.chunks)
72
+ b.chunks = newChunks
73
+ }
74
b.chunks = append(b.chunks, smallChunk{
75
XORChunk: *chunkenc.NewXORChunk(),
76
start: int64(start),
0 commit comments