Open mbauman opened 9 years ago
FWIW, there was a recent talk at CppCon by Chandler Carruth where he demonstrates some interesting micro benchmarks problems precisely by benchmarking push_back
, see https://youtu.be/nXaxk27zwlk?t=924
The way he does it is he measures the time to create the vector and push into it and to only create the vector, separately, then takes the difference between the two.
The talk is quite interesting because he talks about some of the problems that this package also deals with (inlining of functions, defeating the optimizer etc).
This is particularly strange for things like
push!
: