MCPcopy Create free account
hub / github.com/cockroachdb/swiss / benchmarkRuntimeMapPutReuse

Function benchmarkRuntimeMapPutReuse

bench_test.go:363–380  ·  view source on GitHub ↗
(
	b *testing.B, n int, genKeys func(start, end int) []T,
)

Source from the content-addressed store, hash-verified

361}
362
363func benchmarkRuntimeMapPutReuse[T benchTypes](
364 b *testing.B, n int, genKeys func(start, end int) []T,
365) {
366 c := perfbench.Open(b)
367
368 m := make(map[T]T, n)
369 keys := genKeys(0, n)
370 b.ResetTimer()
371 c.Reset()
372 for i := 0; i < b.N; i++ {
373 for _, k := range keys {
374 m[k] = k
375 }
376 for k := range m {
377 delete(m, k)
378 }
379 }
380}
381
382func benchmarkSwissMapPutReuse[T benchTypes](
383 b *testing.B, n int, genKeys func(start, end int) []T,

Callers

nothing calls this directly

Calls 1

genKeysFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…