MCPcopy Create free account
hub / github.com/dgraph-io/dgraph-benchmarks / newFreeCache

Function newFreeCache

cachebench/cache_bench_test.go:189–200  ·  view source on GitHub ↗
(keysInWindow int)

Source from the content-addressed store, hash-verified

187}
188
189func newFreeCache(keysInWindow int) *FreeCache {
190 cache := freecache.NewCache(keysInWindow * maxKeyLength)
191
192 // Enforce full initialization of internal structures
193 // (probably not required, see above in bigcache)
194 for i := 0; i < 2*workloadSize; i++ {
195 _ = cache.Set([]byte(strconv.Itoa(i)), []byte("data"), 0)
196 }
197 cache.Clear()
198
199 return &FreeCache{cache}
200}
201
202//========================================================================
203// GroupCache

Callers 1

BenchmarkCachesFunction · 0.85

Calls 1

SetMethod · 0.95

Tested by

no test coverage detected