| 149 | } |
| 150 | |
| 151 | static void BenchmarkJSONReading(benchmark::State& state, // NOLINT non-const reference |
| 152 | const std::string& json, ReadOptions read_options, |
| 153 | ParseOptions parse_options) { |
| 154 | for (auto _ : state) { |
| 155 | std::shared_ptr<io::InputStream> input; |
| 156 | ABORT_NOT_OK(MakeStream(json, &input)); |
| 157 | |
| 158 | ASSERT_OK_AND_ASSIGN(auto reader, TableReader::Make(default_memory_pool(), input, |
| 159 | read_options, parse_options)); |
| 160 | |
| 161 | std::shared_ptr<Table> table = *reader->Read(); |
| 162 | } |
| 163 | |
| 164 | state.SetBytesProcessed(state.iterations() * json.size()); |
| 165 | state.counters["json_size"] = static_cast<double>(json.size()); |
| 166 | } |
| 167 | |
| 168 | static void BenchmarkReadJSONBlockWithSchema( |
| 169 | benchmark::State& state, // NOLINT non-const reference |
no test coverage detected