| 123 | } |
| 124 | |
| 125 | static void BenchmarkJSONParsing(benchmark::State& state, // NOLINT non-const reference |
| 126 | const std::shared_ptr<Buffer>& json, |
| 127 | ParseOptions options) { |
| 128 | for (auto _ : state) { |
| 129 | std::unique_ptr<BlockParser> parser; |
| 130 | ABORT_NOT_OK(BlockParser::Make(options, &parser)); |
| 131 | ABORT_NOT_OK(parser->Parse(json)); |
| 132 | |
| 133 | std::shared_ptr<Array> parsed; |
| 134 | ABORT_NOT_OK(parser->Finish(&parsed)); |
| 135 | } |
| 136 | state.SetBytesProcessed(state.iterations() * json->size()); |
| 137 | state.counters["json_size"] = static_cast<double>(json->size()); |
| 138 | } |
| 139 | |
| 140 | static void ParseJSONBlockWithSchema( |
| 141 | benchmark::State& state) { // NOLINT non-const reference |
no test coverage detected