| 198 | } |
| 199 | |
| 200 | static void BenchmarkJSONReading(benchmark::State& state, // NOLINT non-const reference |
| 201 | const std::string& json, ReadOptions read_options, |
| 202 | ParseOptions parse_options) { |
| 203 | for (auto _ : state) { |
| 204 | std::shared_ptr<io::InputStream> input; |
| 205 | ABORT_NOT_OK(MakeStream(json, &input)); |
| 206 | |
| 207 | ASSERT_OK_AND_ASSIGN(auto reader, TableReader::Make(default_memory_pool(), input, |
| 208 | read_options, parse_options)); |
| 209 | |
| 210 | std::shared_ptr<Table> table = *reader->Read(); |
| 211 | } |
| 212 | |
| 213 | state.SetBytesProcessed(state.iterations() * json.size()); |
| 214 | state.counters["json_size"] = static_cast<double>(json.size()); |
| 215 | } |
| 216 | |
| 217 | static void BenchmarkReadJSONBlockWithSchema( |
| 218 | benchmark::State& state, // NOLINT non-const reference |
no test coverage detected