This benchmarks acts as a reference to the native std::vector implementation. It appends kRounds chunks into a vector.
| 469 | // This benchmarks acts as a reference to the native std::vector |
| 470 | // implementation. It appends kRounds chunks into a vector. |
| 471 | static void ReferenceBuildVectorNoNulls( |
| 472 | benchmark::State& state) { // NOLINT non-const reference |
| 473 | for (auto _ : state) { |
| 474 | std::vector<int64_t> builder; |
| 475 | |
| 476 | for (int i = 0; i < kRounds; i++) { |
| 477 | builder.insert(builder.end(), kData.cbegin(), kData.cend()); |
| 478 | } |
| 479 | } |
| 480 | |
| 481 | state.SetBytesProcessed(state.iterations() * kBytesProcessed); |
| 482 | state.SetItemsProcessed(state.iterations() * kItemsProcessed); |
| 483 | } |
| 484 | |
| 485 | BENCHMARK(ReferenceBuildVectorNoNulls); |
| 486 |