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

Function BenchmarkOnearr

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

Source from the content-addressed store, hash-verified

202}
203
204func BenchmarkOnearr(b *testing.B) {
205 for api, testsize := range testSizes {
206 b.Run(testsize.Name, func(b *testing.B) {
207 verify := verifyIndex[api]
208 ap := testsize.AP
209 b.SetBytes(int64(ap.TotalSize()))
210 for i := 0; i < b.N; i++ {
211 it := onearr.NewIterator(ap)
212 total := 0
213 for index, err := it.Next(); err == nil; index, err = it.Next() {
214 total += verify[index] * index
215 }
216 _ = total
217 }
218 })
219 }
220}
221
222func TestOnearrRev(t *testing.T) {
223 testIterator(t, func(ap *shape.AP) Iterator { return onearrrev.NewIterator(ap) })

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