How big is the performance gap between std::sort and std::stable_sort in practice?

后端 未结 7 2079
我在风中等你
我在风中等你 2021-01-30 23:00

Both should run in O(n log n), but in general sort is faster than stable_sort. How big is the performance gap in practice? Do you have some experience about that?

I want

7条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-30 23:05

    Big enough to warrant a separate function that does stable sort and not have std::sort() do it transparently.

提交回复
热议问题