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

Function BenchmarkUnroll

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

Source from the content-addressed store, hash-verified

362}
363
364func BenchmarkUnroll(b *testing.B) {
365 for api, testsize := range testSizes {
366 b.Run(testsize.Name, func(b *testing.B) {
367 verify := verifyIndex[api]
368 ap := testsize.AP
369 b.SetBytes(int64(ap.TotalSize()))
370 for i := 0; i < b.N; i++ {
371 it := unroll.NewIterator(ap)
372 total := 0
373 for index, err := it.Next(); err == nil; index, err = it.Next() {
374 total += verify[index] * index
375 }
376 _ = total
377 }
378 })
379 }
380}
381
382func TestUnrollReverse(t *testing.T) {
383 testIterator(t, func(ap *shape.AP) Iterator { return unrollreverse.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