| 78 | // With ARROW_NOINLINE, try to make sure the number of items is not constant-propagated |
| 79 | template <typename Vector> |
| 80 | ARROW_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 | |
| 96 | template <typename Vector> |
| 97 | void MoveEmptyVector(benchmark::State& state) { |
no test coverage detected