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

Function BenchmarkJSONChunking

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

Source from the content-addressed store, hash-verified

84FieldVector TestFields() { return {field("int", int32()), field("str", utf8())}; }
85
86static void BenchmarkJSONChunking(benchmark::State& state, // NOLINT non-const reference
87 const std::shared_ptr<Buffer>& json,
88 ParseOptions options) {
89 auto chunker = MakeChunker(options);
90
91 for (auto _ : state) {
92 std::shared_ptr<Buffer> chunked, partial;
93 ABORT_NOT_OK(chunker->Process(json, &chunked, &partial));
94 }
95
96 state.SetBytesProcessed(state.iterations() * json->size());
97 state.counters["json_size"] = static_cast<double>(json->size());
98}
99
100static void ChunkJSONPrettyPrinted(
101 benchmark::State& state) { // NOLINT non-const reference

Callers 2

ChunkJSONPrettyPrintedFunction · 0.85
ChunkJSONLineDelimitedFunction · 0.85

Calls 3

MakeChunkerFunction · 0.70
ProcessMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected