3 ms·
They use the Google Benchmark library. (I would read into it to answer your actual questions)
by mackal 8y ago
They use the Google Benchmark library. (I would read into it to answer your actual questions)
- petermcneeley 8y agoAlso looks like randString generation will dominate for small arrays for (size_t i = 0; i < kLookups; ++i) { benchmark::DoNotOptimize(std::find(vec.begin(), vec.end(), randString())); } Also does that allocate a new string every call?
- AstralStorm 8y agoYes, this benchmark is relatively flawed. Allocating a new string simulates heap fragmentation.
- petermcneeley 8y agoThe post was updated as the results were incorrect.