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

Function BenchmarkPremul

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

Source from the content-addressed store, hash-verified

177}
178
179func BenchmarkPremul(b *testing.B) {
180 if skipUseless {
181 b.Skip("skipping useless approach")
182 }
183 for api, testsize := range testSizes {
184 b.Run(testsize.Name, func(b *testing.B) {
185 verify := verifyIndex[api]
186 ap := testsize.AP
187 b.SetBytes(int64(ap.TotalSize()))
188 for i := 0; i < b.N; i++ {
189 it := premul.NewIterator(ap)
190 total := 0
191 for index, err := it.Next(); err == nil; index, err = it.Next() {
192 total += verify[index] * index
193 }
194 _ = total
195 }
196 })
197 }
198}
199
200func TestOnearr(t *testing.T) {
201 testIterator(t, func(ap *shape.AP) Iterator { return onearr.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