perf: store/cachekv: preallocate kvL in dirtyItems which gets appended too (#14168)

This commit is contained in:
Emmanuel T Odeke 2022-12-07 01:00:02 -08:00 committed by GitHub
parent c8d7b74259
commit 0115f88ebc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -339,7 +339,7 @@ func (store *Store) dirtyItems(start, end []byte) {
}
}
kvL := make([]*kv.Pair, 0)
kvL := make([]*kv.Pair, 0, 1+endIndex-startIndex)
for i := startIndex; i <= endIndex; i++ {
key := strL[i]
cacheValue := store.cache[key]