Should we make radix sort the primary option for sorting?

Julia’s default sorting is not a simple algorithm but a rather complex pipeline thanks to awesome work by @Lilith :slight_smile: I highly recommend checking out her JuliaCon 2023 talk about the full sorting pipeline https://www.youtube.com/watch?v=dXkNazmV9pA.

For reference this is what it looks like in my Julia 1.10.2 and if you look closely there is a RadixSort in there for a suitable case:

julia> Base.Sort.DEFAULT_STABLE
Base.Sort.MissingOptimization(
    Base.Sort.BoolOptimization(
        Base.Sort.Small{10}(
            Base.Sort.InsertionSortAlg(),
            Base.Sort.IEEEFloatOptimization(
                Base.Sort.IsUIntMappable(
                    Base.Sort.Small{40}(
                        Base.Sort.InsertionSortAlg(),
                        Base.Sort.CheckSorted(
                            Base.Sort.ComputeExtrema(
                                Base.Sort.ConsiderCountingSort(
                                    Base.Sort.CountingSort(),
                                    Base.Sort.ConsiderRadixSort(
                                        Base.Sort.RadixSort(),
                                        Base.Sort.Small{80}(
                                            Base.Sort.InsertionSortAlg(),
                                            Base.Sort.ScratchQuickSort(missing, missing,
                                                Base.Sort.InsertionSortAlg()))))))),
                    Base.Sort.StableCheckSorted(
                        Base.Sort.ScratchQuickSort(missing, missing,
                            Base.Sort.InsertionSortAlg())))))))
10 Likes