MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / BenchmarkCounter_GC

Function BenchmarkCounter_GC

internal/utils/counters/counter_test.go:179–197  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

177}
178
179func BenchmarkCounter_GC(b *testing.B) {
180 runtime.GOMAXPROCS(4)
181
182 var counter = counters.NewCounter[uint32]()
183
184 for i := uint64(0); i < 1e5; i++ {
185 counter.IncreaseKey(types.String(i), 20)
186 }
187
188 b.ResetTimer()
189
190 b.RunParallel(func(pb *testing.PB) {
191 for pb.Next() {
192 counter.GC()
193 }
194 })
195
196 //b.Log(counter.TotalItems())
197}

Callers

nothing calls this directly

Calls 4

IncreaseKeyMethod · 0.80
NextMethod · 0.80
GCMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected