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

Function BenchmarkItems

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

Source from the content-addressed store, hash-verified

7)
8
9func BenchmarkItems(b *testing.B) {
10 slm := NewShardLockMaps()
11
12 for i := 0; i < 10000; i++ {
13 slm.Set(strconv.Itoa(i), TestUser{strconv.Itoa(i)})
14 }
15 for i := 0; i < b.N; i++ {
16 slm.Items()
17 }
18}
19
20func BenchmarkKeys(b *testing.B) {
21 slm := NewShardLockMaps()

Callers

nothing calls this directly

Calls 3

SetMethod · 0.95
ItemsMethod · 0.95
NewShardLockMapsFunction · 0.85

Tested by

no test coverage detected