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

Function BenchmarkUnrollReverse

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

Source from the content-addressed store, hash-verified

384}
385
386func BenchmarkUnrollReverse(b *testing.B) {
387 for api, testsize := range testSizes {
388 b.Run(testsize.Name, func(b *testing.B) {
389 verify := verifyIndex[api]
390 ap := testsize.AP
391 b.SetBytes(int64(ap.TotalSize()))
392 for i := 0; i < b.N; i++ {
393 it := unrollreverse.NewIterator(ap)
394 total := 0
395 for index, err := it.Next(); err == nil; index, err = it.Next() {
396 total += verify[index] * index
397 }
398 _ = total
399 }
400 })
401 }
402}
403
404func TestUnrollInverse(t *testing.T) {
405 testIterator(t, func(ap *shape.AP) Iterator { return unrollinverse.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