26 Sep
2017
26 Sep
'17
4:09 p.m.
On 26. Sep 2017, at 03:39, Zach Laine via Boost
wrote: On Mon, Sep 25, 2017 at 12:17 PM, Thorsten Ottosen via Boost < boost@lists.boost.org mailto:boost@lists.boost.org> wrote:
For devector: -------------
Is it it not obvious that an O(1) push_front performs better than an O(n) vec.insert( vec.begin(), x ) ?
I find the use of the word "obvious" when applied to optimization to be a little suspect.
I wanted to say the same. I got my fair share of surprises when I benchmarked code that I expected to run faster than some other code. I can recommend Google Benchmark for micro-benchmarks, it is quite neat. https://github.com/google/benchmark Best regards, Hans