MCPcopy Create free account
hub / github.com/egonelbre/exp / BenchmarkInstruct

Function BenchmarkInstruct

niterator/iterator_test.go:123–142  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

121}
122
123func BenchmarkInstruct(b *testing.B) {
124 if skipUseless {
125 b.Skip("skipping useless approach")
126 }
127 for api, testsize := range testSizes {
128 b.Run(testsize.Name, func(b *testing.B) {
129 verify := verifyIndex[api]
130 ap := testsize.AP
131 b.SetBytes(int64(ap.TotalSize()))
132 for i := 0; i < b.N; i++ {
133 it := instruct.NewIterator(ap)
134 total := 0
135 for index, err := it.Next(); err == nil; index, err = it.Next() {
136 total += verify[index] * index
137 }
138 _ = total
139 }
140 })
141 }
142}
143
144func TestOrdone(t *testing.T) {
145 if skipUseless {

Callers

nothing calls this directly

Calls 4

NextMethod · 0.95
NewIteratorFunction · 0.92
TotalSizeMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected