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

Function BenchmarkSpecialize

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

Source from the content-addressed store, hash-verified

340}
341
342func BenchmarkSpecialize(b *testing.B) {
343 for api, testsize := range testSizes {
344 b.Run(testsize.Name, func(b *testing.B) {
345 verify := verifyIndex[api]
346 ap := testsize.AP
347 b.SetBytes(int64(ap.TotalSize()))
348 for i := 0; i < b.N; i++ {
349 it := specialize.NewIterator(ap)
350 total := 0
351 for index, err := it.Next(); err == nil; index, err = it.Next() {
352 total += verify[index] * index
353 }
354 _ = total
355 }
356 })
357 }
358}
359
360func TestUnroll(t *testing.T) {
361 testIterator(t, func(ap *shape.AP) Iterator { return unroll.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