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

Function BenchmarkJSONParsing

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

Source from the content-addressed store, hash-verified

123}
124
125static 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
140static void ParseJSONBlockWithSchema(
141 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