MCPcopy
hub / github.com/cornelk/hashmap / BenchmarkReadGoMapUintMutex

Function BenchmarkReadGoMapUintMutex

benchmarks/benchmark_test.go:200–216  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

198}
199
200func BenchmarkReadGoMapUintMutex(b *testing.B) {
201 m := setupGoMap(b)
202 l := &sync.RWMutex{}
203 b.ResetTimer()
204 b.RunParallel(func(pb *testing.PB) {
205 for pb.Next() {
206 for i := uintptr(0); i < benchmarkItemCount; i++ {
207 l.RLock()
208 j := m[i]
209 l.RUnlock()
210 if j != i {
211 b.Fail()
212 }
213 }
214 }
215 })
216}
217
218func BenchmarkReadGoMapWithWritesUintMutex(b *testing.B) {
219 m := setupGoMap(b)

Callers

nothing calls this directly

Calls 2

setupGoMapFunction · 0.85
NextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…