MCPcopy Index your code
hub / github.com/aceld/zinx / benchmarkMultiGetSetDifferentWithMap

Function benchmarkMultiGetSetDifferentWithMap

zutils/shard_lock_map_bench_test.go:324–334  ·  view source on GitHub ↗
(slm ShardLockMaps, b *testing.B)

Source from the content-addressed store, hash-verified

322}
323
324func benchmarkMultiGetSetDifferentWithMap(slm ShardLockMaps, b *testing.B) {
325 finished := make(chan struct{}, 2*b.N)
326 get, set := GetSet(slm, finished)
327 for i := 0; i < b.N; i++ {
328 go get(strconv.Itoa(i), "value")
329 go set(strconv.Itoa(i), "value")
330 }
331 for i := 0; i < 2*b.N; i++ {
332 <-finished
333 }
334}
335
336func benchmarkMultiGetSetBlockWithMap(slm ShardLockMaps, b *testing.B) {
337 finished := make(chan struct{}, 2*b.N)

Calls 1

GetSetFunction · 0.85

Tested by

no test coverage detected