If you're curious why you would want a vectorized way to sort lists of numbers, one use case is building histograms - it's much easier to build a histogram if you've sorted all your samples first
I wonder what apps have implemented this now that a few years have passed.
Actual sense in which it’s first:
> Happily, modern instruction sets (Arm SVE, RISC-V V, x86 AVX-512) include a special instruction suitable for partitioning. Given a separate input of yes/no values (whether an element is less than the pivot), this "compress-store" instruction stores to consecutive memory only the elements whose corresponding input is "yes". We can then logically negate the yes/no values and apply the instruction again to write the elements to the other partition. This strategy has been used in an AVX-512-specific Quicksort. But what about other instruction sets such as AVX2 that don't have compress-store? Previous work has shown how to emulate this instruction using permute instructions.
> We build on these techniques to achieve the first vectorized Quicksort that is portable to six instruction sets across three architectures, and in fact outperforms prior architecture-specific sorts.
Would they do the same thing today or have an LLM re-implement those 3000 lines of c++ ?
There’s something sort of beautiful about mergesort and heapsort. Their names tell you what their main idea is, and how they work is immediately obvious.
Quicksort, on the other hand, has nothing beautiful about it and is named after it’s one redeeming feature (that it is quick for a lot of cases).
Since pdqsort, vqsort, and glide sort, the current state-of-the-art are driftsort and ipnsort.
I've integrated them into ClickHouse: https://github.com/ClickHouse/ClickHouse/pull/106650
Only the likes of MAG 7, and a couple of hedge-funds would ask to do it since this problem directly applies to them.
But certainly not pre-revenue startups.
glouwbug•57m ago