| 395 | } |
| 396 | |
| 397 | static 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 |
nothing calls this directly
no test coverage detected