| 75 | } |
| 76 | |
| 77 | static void BenchmarkCSVChunking(benchmark::State& state, // NOLINT non-const reference |
| 78 | const std::string& csv, ParseOptions options) { |
| 79 | auto chunker = MakeChunker(options); |
| 80 | auto block = std::make_shared<Buffer>(std::string_view(csv)); |
| 81 | |
| 82 | while (state.KeepRunning()) { |
| 83 | std::shared_ptr<Buffer> whole, partial; |
| 84 | ABORT_NOT_OK(chunker->Process(block, &whole, &partial)); |
| 85 | auto size = whole->size(); |
| 86 | benchmark::DoNotOptimize(size); |
| 87 | } |
| 88 | |
| 89 | state.SetBytesProcessed(state.iterations() * csv.length()); |
| 90 | } |
| 91 | |
| 92 | static void BenchmarkCSVChunking(benchmark::State& state, // NOLINT non-const reference |
| 93 | const Example& example, ParseOptions options) { |
no test coverage detected