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

Function benchmarkSwissMapIter

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

Source from the content-addressed store, hash-verified

185}
186
187func benchmarkSwissMapIter[T benchTypes](b *testing.B, n int, genKeys func(start, end int) []T) {
188 c := perfbench.Open(b)
189
190 m := New[T, T](n)
191 keys := genKeys(0, n)
192 for _, k := range keys {
193 m.Put(k, k)
194 }
195 b.ResetTimer()
196 c.Reset()
197 var tmp T
198 for i := 0; i < b.N; i++ {
199 m.All(func(k, v T) bool {
200 tmp += k + v
201 return true
202 })
203 }
204}
205
206func benchmarkRuntimeMapGetMiss[T benchTypes](
207 b *testing.B, n int, genKeys func(start, end int) []T,

Callers

nothing calls this directly

Calls 3

genKeysFunction · 0.85
PutMethod · 0.80
AllMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…