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

Function ArrayDataConstructDestruct

cpp/src/arrow/builder_benchmark.cc:397–413  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

395}
396
397static void ArrayDataConstructDestruct(
398 benchmark::State& state) { // NOLINT non-const reference
399 std::vector<std::shared_ptr<ArrayData>> arrays;
400
401 const int kNumArrays = 1000;
402 auto InitArrays = [&]() {
403 for (int i = 0; i < kNumArrays; ++i) {
404 arrays.emplace_back(new ArrayData);
405 }
406 };
407
408 for (auto _ : state) {
409 InitArrays();
410 arrays.clear();
411 }
412 state.SetItemsProcessed(state.iterations() * kNumArrays);
413}
414
415// ----------------------------------------------------------------------
416// BufferBuilder benchmarks

Callers

nothing calls this directly

Calls 2

emplace_backMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected