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

Function BenchmarkJSONReading

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

Source from the content-addressed store, hash-verified

149}
150
151static 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
168static void BenchmarkReadJSONBlockWithSchema(
169 benchmark::State& state, // NOLINT non-const reference

Callers 1

Calls 3

MakeStreamFunction · 0.70
ReadMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected