diff --git a/src/bench/prevector.cpp b/src/bench/prevector.cpp index 9b83c42693fd3..adc3d18de000c 100644 --- a/src/bench/prevector.cpp +++ b/src/bench/prevector.cpp @@ -87,6 +87,7 @@ static void PrevectorFillVectorDirect(benchmark::Bench& bench) { bench.run([&] { std::vector> vec; + vec.reserve(260); for (size_t i = 0; i < 260; ++i) { vec.emplace_back(); } @@ -99,6 +100,7 @@ static void PrevectorFillVectorIndirect(benchmark::Bench& bench) { bench.run([&] { std::vector> vec; + vec.reserve(260); for (size_t i = 0; i < 260; ++i) { // force allocation vec.emplace_back(29, T{});