3 ms·
Are these benchmarks done with cold caches and multithreading? If not then we are not seeing the whole picture here.
by petermcneeley 8y ago
Are these benchmarks done with cold caches and multithreading? If not then we are not seeing the whole picture here.
- mackal 8y agoThey 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.