(b *testing.B)
| 121 | } |
| 122 | |
| 123 | func BenchmarkInstruct(b *testing.B) { |
| 124 | if skipUseless { |
| 125 | b.Skip("skipping useless approach") |
| 126 | } |
| 127 | for api, testsize := range testSizes { |
| 128 | b.Run(testsize.Name, func(b *testing.B) { |
| 129 | verify := verifyIndex[api] |
| 130 | ap := testsize.AP |
| 131 | b.SetBytes(int64(ap.TotalSize())) |
| 132 | for i := 0; i < b.N; i++ { |
| 133 | it := instruct.NewIterator(ap) |
| 134 | total := 0 |
| 135 | for index, err := it.Next(); err == nil; index, err = it.Next() { |
| 136 | total += verify[index] * index |
| 137 | } |
| 138 | _ = total |
| 139 | } |
| 140 | }) |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | func TestOrdone(t *testing.T) { |
| 145 | if skipUseless { |
nothing calls this directly
no test coverage detected