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

Function BenchmarkFixedSet_Has

internal/utils/sets/set_fixed_test.go:48–62  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

46}
47
48func BenchmarkFixedSet_Has(b *testing.B) {
49 var count = 1_000_000
50 var set = setutils.NewFixedSet(count)
51 for i := 0; i < count; i++ {
52 set.Push(i)
53 }
54
55 b.ResetTimer()
56
57 b.RunParallel(func(pb *testing.PB) {
58 for pb.Next() {
59 set.Has(rands.Int(0, 100_000))
60 }
61 })
62}

Callers

nothing calls this directly

Calls 3

NextMethod · 0.80
PushMethod · 0.45
HasMethod · 0.45

Tested by

no test coverage detected