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
Was looking for something similar - but was surprised no one talked about Auxiliary space.
As I believe - the implementation of both stable_sort and sort is supposed to guarantee O(NlogN) for all (Best, Average & Worst) cases.
However, the difference exists in the Auxiliary space used. stable_sort needs an Auxiliary space of O(N).
May be the difference in performance lies in acquiring that space. :)
Otherwise, theoretically - they are supposed to be same w.r.t performance.
sort should do what you need unless you need this -> stable_sort preserves the relative order of the elements with equivalent values.