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

Function newGroupCache

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

Source from the content-addressed store, hash-verified

238}
239
240func newGroupCache(keysInWindow int) *GroupCache {
241 gc := &GroupCache{}
242 for i := 0; i < 256; i++ {
243 gc.shards[i] = lru.New(keysInWindow / 256)
244 }
245
246 // Enforce full initialization of internal structures
247 for j := 0; j < 2*workloadSize; j++ {
248 _ = gc.Set([]byte(strconv.Itoa(j)), []byte("data"))
249 }
250 for i := 0; i < 256; i++ {
251 gc.shards[i].Clear()
252 }
253
254 return gc
255}
256
257//========================================================================
258// Ristretto

Callers 1

BenchmarkCachesFunction · 0.85

Calls 1

SetMethod · 0.95

Tested by

no test coverage detected