MCPcopy Create free account
hub / github.com/apache/arrow / BenchmarkJSONParsing

Function BenchmarkJSONParsing

cpp/src/arrow/json/parser_benchmark.cc:174–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172}
173
174static 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
189static void ParseJSONBlockWithSchema(
190 benchmark::State& state) { // NOLINT non-const reference

Callers 2

ParseJSONBlockWithSchemaFunction · 0.85
ParseJSONFieldsFunction · 0.85

Calls 4

MakeFunction · 0.50
ParseMethod · 0.45
FinishMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected