MCPcopy Index your code
hub / github.com/golang/groupcache / benchmarkGet

Function benchmarkGet

consistenthash/consistenthash_test.go:94–110  ·  view source on GitHub ↗
(b *testing.B, shards int)

Source from the content-addressed store, hash-verified

92func BenchmarkGet512(b *testing.B) { benchmarkGet(b, 512) }
93
94func benchmarkGet(b *testing.B, shards int) {
95
96 hash := New(50, nil)
97
98 var buckets []string
99 for i := 0; i < shards; i++ {
100 buckets = append(buckets, fmt.Sprintf("shard-%d", i))
101 }
102
103 hash.Add(buckets...)
104
105 b.ResetTimer()
106
107 for i := 0; i < b.N; i++ {
108 hash.Get(buckets[i&(shards-1)])
109 }
110}

Callers 4

BenchmarkGet8Function · 0.85
BenchmarkGet32Function · 0.85
BenchmarkGet128Function · 0.85
BenchmarkGet512Function · 0.85

Calls 3

NewFunction · 0.70
GetMethod · 0.65
AddMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…