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

Function BenchmarkJSONChunking

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

Source from the content-addressed store, hash-verified

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