MCPcopy
hub / github.com/aceld/zinx / BenchmarkMultiGetSame

Function BenchmarkMultiGetSame

zutils/shard_lock_map_bench_test.go:144–156  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

142}
143
144func BenchmarkMultiGetSame(b *testing.B) {
145 slm := NewShardLockMaps()
146 finished := make(chan struct{}, b.N)
147 get, _ := GetSet(slm, finished)
148 slm.Set("key", "value")
149 b.ResetTimer()
150 for i := 0; i < b.N; i++ {
151 go get("key", "value")
152 }
153 for i := 0; i < b.N; i++ {
154 <-finished
155 }
156}
157
158func BenchmarkMultiGetSameSyncMap(b *testing.B) {
159 var m sync.Map

Callers

nothing calls this directly

Calls 3

SetMethod · 0.95
NewShardLockMapsFunction · 0.85
GetSetFunction · 0.85

Tested by

no test coverage detected