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

Function BenchmarkUnrollInReverseHardcode

niterator/iterator_test.go:515–529  ·  view source on GitHub ↗

special func TestUnrollInReverseHardcode(t *testing.T) { testIterator(t, unrollinreversehardcode.NewIterator(shape.New(100, 100, 100, 100))) }

(b *testing.B)

Source from the content-addressed store, hash-verified

513// }
514
515func BenchmarkUnrollInReverseHardcode(b *testing.B) {
516 b.Run("100x100x100x100", func(b *testing.B) {
517 verify := verifyIndex[indexOf100x]
518 ap := shape.New(100, 100, 100, 100)
519 b.SetBytes(int64(ap.TotalSize()))
520 for i := 0; i < b.N; i++ {
521 it := unrollinreversehardcode.NewIterator(ap)
522 total := 0
523 for index, err := it.Next(); err == nil; index, err = it.Next() {
524 total += verify[index] * index
525 }
526 _ = total
527 }
528 })
529}

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected