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

Function BenchmarkBasic

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

Source from the content-addressed store, hash-verified

96}
97
98func BenchmarkBasic(b *testing.B) {
99 for api, testsize := range testSizes {
100 b.Run(testsize.Name, func(b *testing.B) {
101 verify := verifyIndex[api]
102 ap := testsize.AP
103 b.SetBytes(int64(ap.TotalSize()))
104 for i := 0; i < b.N; i++ {
105 it := basic.NewIterator(ap)
106 total := 0
107 for index, err := it.Next(); err == nil; index, err = it.Next() {
108 total += verify[index] * index
109 }
110 _ = total
111 }
112 })
113 }
114}
115
116func TestInstruct(t *testing.T) {
117 if skipUseless {

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