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

Function SchemaConstruct

cpp/src/arrow/type_benchmark.cc:173–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171}
172
173static void SchemaConstruct(benchmark::State& state, // NOLINT non-const reference
174 bool duplicate_names) {
175 const int num_fields = static_cast<int>(state.range(0));
176 FieldVector fields(num_fields);
177 for (int i = 0; i < num_fields; ++i) {
178 fields[i] = field(duplicate_names ? "f" : "f" + std::to_string(i), int32());
179 }
180
181 for (auto _ : state) {
182 benchmark::DoNotOptimize(::arrow::schema(fields));
183 }
184 state.SetItemsProcessed(state.iterations() * num_fields);
185}
186
187// ------------------------------------------------------------------------
188// Micro-benchmark various error reporting schemes

Callers

nothing calls this directly

Calls 3

to_stringFunction · 0.85
fieldFunction · 0.70
schemaFunction · 0.70

Tested by

no test coverage detected