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

Function BenchmarkSingleInsertAbsent

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

Source from the content-addressed store, hash-verified

49}
50
51func BenchmarkSingleInsertAbsent(b *testing.B) {
52 slm := NewShardLockMaps()
53 b.ResetTimer()
54 for i := 0; i < b.N; i++ {
55 slm.Set(strconv.Itoa(i), "value")
56 }
57}
58
59func BenchmarkSingleInsertAbsentSyncMap(b *testing.B) {
60 var m sync.Map

Callers

nothing calls this directly

Calls 2

SetMethod · 0.95
NewShardLockMapsFunction · 0.85

Tested by

no test coverage detected