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

Function BenchmarkMultiInsertSame

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

Source from the content-addressed store, hash-verified

114}
115
116func BenchmarkMultiInsertSame(b *testing.B) {
117 slm := NewShardLockMaps()
118 finished := make(chan struct{}, b.N)
119 _, set := GetSet(slm, finished)
120 slm.Set("key", "value")
121 b.ResetTimer()
122 for i := 0; i < b.N; i++ {
123 go set("key", "value")
124 }
125 for i := 0; i < b.N; i++ {
126 <-finished
127 }
128}
129
130func BenchmarkMultiInsertSameSyncMap(b *testing.B) {
131 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