rust/library/core
Lukas Bergdoll 13d7b546da Add binary-size optimized variants for stable and unstable sort as well as select_nth_unstable
- Stable sort uses a simple merge-sort that re-uses the existing - rather gnarly - merge function.
- Unstable sort jumps directly to the branchless heapsort fallback.
- select_nth_unstable jumps directly to the median_of_medians fallback, which is augmented with a
  custom tiny smallsort and partition impl.

Some code is duplicated but de-duplication would bring it's own problems. For example `swap_if_less`
is critical for performance, if the sorting networks don't inline it perf drops drastically,
however `#[inline(always)]` is also a poor fit, if the provided comparison function is huge,
it gives the compiler an out to only instantiate `swap_if_less` once and call it. Another aspect
that would suffer when making `swap_if_less` pub, is having to cfg out dozens of functions in
in smallsort module.
2024-08-25 20:47:01 +02:00
..
benches Reformat use declarations. 2024-07-29 08:26:52 +10:00
src Add binary-size optimized variants for stable and unstable sort as well as select_nth_unstable 2024-08-25 20:47:01 +02:00
tests Auto merge of #129365 - matthiaskrgr:rollup-ebwx6ya, r=matthiaskrgr 2024-08-22 05:17:27 +00:00
Cargo.toml Cleanup bootstrap check-cfg 2024-06-27 11:30:03 +02:00