diff --git a/store/cachemulti/store.go b/store/cachemulti/store.go index 16c69ce67841..8b1c4531008a 100644 --- a/store/cachemulti/store.go +++ b/store/cachemulti/store.go @@ -13,6 +13,9 @@ import ( // the store which emitted a given trace. const storeNameCtxKey = "store_name" +// storesPreAllocation is the pre-allocate size for the stores map +const storesPreAllocation = 8 + //---------------------------------------- // Store @@ -68,7 +71,7 @@ func NewFromParent( traceWriter io.Writer, traceContext types.TraceContext, ) Store { return Store{ - stores: make(map[types.StoreKey]types.CacheWrap), + stores: make(map[types.StoreKey]types.CacheWrap, storesPreAllocation), traceWriter: traceWriter, traceContext: traceContext, parentStore: parentStore,