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

Function BenchmarkMoveVector

cpp/src/arrow/util/small_vector_benchmark.cc:80–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78// With ARROW_NOINLINE, try to make sure the number of items is not constant-propagated
79template <typename Vector>
80ARROW_NOINLINE void BenchmarkMoveVector(benchmark::State& state, Vector vec) {
81 constexpr int kNumIters = 1000;
82
83 for (auto _ : state) {
84 int64_t dummy = 0;
85 for (int i = 0; i < kNumIters; ++i) {
86 Vector tmp(std::move(vec));
87 dummy += IngestVector(tmp);
88 vec = std::move(tmp);
89 }
90 benchmark::DoNotOptimize(dummy);
91 }
92
93 state.SetItemsProcessed(state.iterations() * kNumIters * 2);
94}
95
96template <typename Vector>
97void MoveEmptyVector(benchmark::State& state) {

Callers 2

MoveEmptyVectorFunction · 0.85
MoveShortVectorFunction · 0.85

Calls 1

IngestVectorFunction · 0.85

Tested by

no test coverage detected