Benchmarks for std::sort, std::stable_sort, std::make_heap,
std::sort_heap, std::pop_heap and std::push_heap.
The benchmarks are run with integers and strings, and with different
sorted input.
Differential D53978
Add benchmarks for sorting and heap functions. ClosedPublic Authored by sbenza on Nov 1 2018, 8:33 AM.
Details Summary Benchmarks for std::sort, std::stable_sort, std::make_heap, The benchmarks are run with integers and strings, and with different
Diff Detail
Event TimelineHerald added subscribers: libcxx-commits, ldionne, mgrang, christof. · View Herald TranscriptNov 1 2018, 8:33 AM Comment Actions Is there any value in breaking these out into one benchmark per file? I can see this file ever-growing as we add new benchmarks. Comment Actions
No idea. I was just following the pattern of one benchmark .cpp per header. I think <algorithm> would be the only one with the potential bloat. Comment Actions
I don't thin so. If you want to run a single benchmark in a file, you can use --benchmark_filter=<regex> to select it. Otherwise, this LGTM.
This revision is now accepted and ready to land.Nov 19 2018, 2:35 PM Closed by commit rL347329: Add benchmarks for sorting and heap functions. (authored by sbenza). · Explain WhyNov 20 2018, 9:18 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 174666 benchmarks/algorithms.bench.cpp
|
For stable sort we want to explore more input sizes between 1 and 200. Currently stable sort is adaptive on the input size, switching to insertion sort for inputs smaller than 128. This seems to cause us to perform 2x worse for inputs of 100 elements. Early experiments show we perform better when the switch is around 16 to 32 elements, but we should have some coverage to prove it.