2 When sorting primitive values (integers, bools, chars, as well
3 as arrays, slices, and tuples of such items), it is typically better to
4 use an unstable sort than a stable sort.
7 Typically, using a stable sort consumes more memory and cpu cycles.
8 Because values which compare equal are identical, preserving their
9 relative order (the guarantee that a stable sort provides) means
10 nothing, while the extra costs still apply.
15 [issue #8241](https://github.com/rust-lang/rust-clippy/issues/8241),
16 a stable sort can instead be significantly faster for certain scenarios
17 (eg. when a sorted vector is extended with new data and resorted).
19 For more information and benchmarking results, please refer to the
24 let mut vec = vec![2, 1, 3];
29 let mut vec = vec![2, 1, 3];