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

Function BenchmarkUnrollInverse

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

Source from the content-addressed store, hash-verified

406}
407
408func BenchmarkUnrollInverse(b *testing.B) {
409 for api, testsize := range testSizes {
410 b.Run(testsize.Name, func(b *testing.B) {
411 verify := verifyIndex[api]
412 ap := testsize.AP
413 b.SetBytes(int64(ap.TotalSize()))
414 for i := 0; i < b.N; i++ {
415 it := unrollinverse.NewIterator(ap)
416 total := 0
417 for index, err := it.Next(); err == nil; index, err = it.Next() {
418 total += verify[index] * index
419 }
420 _ = total
421 }
422 })
423 }
424}
425
426func TestUnrollInReverse(t *testing.T) {
427 testIterator(t, func(ap *shape.AP) Iterator { return unrollinreverse.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