| 85 | } |
| 86 | |
| 87 | static void BenchmarkConversion(benchmark::State& state, // NOLINT non-const reference |
| 88 | BlockParser& parser, |
| 89 | const std::shared_ptr<DataType>& type, |
| 90 | ConvertOptions options) { |
| 91 | std::shared_ptr<Converter> converter = |
| 92 | *Converter::Make(type, options, memory_tracker.memory_pool()); |
| 93 | |
| 94 | while (state.KeepRunning()) { |
| 95 | auto converted = *converter->Convert(parser, 0 /* col_index */); |
| 96 | if (converted->length() != parser.num_rows()) { |
| 97 | std::cerr << "Conversion incomplete\n"; |
| 98 | std::abort(); |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | state.SetItemsProcessed(state.iterations() * parser.num_rows()); |
| 103 | } |
| 104 | |
| 105 | constexpr size_t num_rows = 10000; |
| 106 |
no test coverage detected