| 172 | } |
| 173 | |
| 174 | static void BenchmarkJSONParsing(benchmark::State& state, // NOLINT non-const reference |
| 175 | const std::shared_ptr<Buffer>& json, |
| 176 | ParseOptions options) { |
| 177 | for (auto _ : state) { |
| 178 | std::unique_ptr<BlockParser> parser; |
| 179 | ABORT_NOT_OK(BlockParser::Make(options, &parser)); |
| 180 | ABORT_NOT_OK(parser->Parse(json)); |
| 181 | |
| 182 | std::shared_ptr<Array> parsed; |
| 183 | ABORT_NOT_OK(parser->Finish(&parsed)); |
| 184 | } |
| 185 | state.SetBytesProcessed(state.iterations() * json->size()); |
| 186 | state.counters["json_size"] = static_cast<double>(json->size()); |
| 187 | } |
| 188 | |
| 189 | static void ParseJSONBlockWithSchema( |
| 190 | benchmark::State& state) { // NOLINT non-const reference |
no test coverage detected