Today Crystal’s only option for sorting is “unstable” but fast quicksort.
This means that things like ary.sort_by(&.x).sort_by(&.x) don’t actually make sense, the second sort_by scrambles what the first did. Java gets around this by sorting “stably” by default.
There’s also some “other” sort algorithms that take up slightly more space but are “faster” than quicksort.
So the question of the day is…what should the default sort behavior best be? Fast? Stable? Even faster but using more memory? Stable for just sort_by?
Thoughts and opinions welcome here! I just wasn’t sure if crystal focuses more on “ease” to the programmer, or more on “speed” by default, so asking for a poll here to learn more. Thanks!