(b *testing.B, makeIter makeTestIterFn)
| 244 | } |
| 245 | |
| 246 | func benchmarkColumnIterator(b *testing.B, makeIter makeTestIterFn) { |
| 247 | count := 100_000 |
| 248 | pf := createTestFile(b, count) |
| 249 | |
| 250 | idx, _, _ := GetColumnIndexByPath(pf, "A") |
| 251 | |
| 252 | b.ResetTimer() |
| 253 | |
| 254 | for i := 0; i < b.N; i++ { |
| 255 | iter := makeIter(pf, idx, nil, "A") |
| 256 | actualCount := 0 |
| 257 | for { |
| 258 | res, err := iter.Next() |
| 259 | require.NoError(b, err) |
| 260 | if res == nil { |
| 261 | break |
| 262 | } |
| 263 | actualCount++ |
| 264 | } |
| 265 | iter.Close() |
| 266 | require.Equal(b, count, actualCount) |
| 267 | } |
| 268 | } |
| 269 | |
| 270 | func createTestFile(t testing.TB, count int) *parquet.File { |
| 271 | type T struct{ A int } |
no test coverage detected