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

Function BenchmarkJSONReading

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

Source from the content-addressed store, hash-verified

198}
199
200static void BenchmarkJSONReading(benchmark::State& state, // NOLINT non-const reference
201 const std::string& json, ReadOptions read_options,
202 ParseOptions parse_options) {
203 for (auto _ : state) {
204 std::shared_ptr<io::InputStream> input;
205 ABORT_NOT_OK(MakeStream(json, &input));
206
207 ASSERT_OK_AND_ASSIGN(auto reader, TableReader::Make(default_memory_pool(), input,
208 read_options, parse_options));
209
210 std::shared_ptr<Table> table = *reader->Read();
211 }
212
213 state.SetBytesProcessed(state.iterations() * json.size());
214 state.counters["json_size"] = static_cast<double>(json.size());
215}
216
217static void BenchmarkReadJSONBlockWithSchema(
218 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