logoalt Hacker News

A C++ Quicksort Faster Than std:sort

20 points • by signa11 • yesterday at 6:28 AM • 5 comments • view on HN

Comments

omoikane • today at 7:22 PM

Previously:

https://news.ycombinator.com/item?id=48375445 - Branchless Quicksort faster than std:sort and pdqsort with C and C++ API (2026-06-02, 82 comments)

brudgers • today at 1:04 AM

Quicksort is quick because it's space requirements are not just linear but very very close to n. It is quick because it minimizes IO.

To be clear I did not look at the code, but benchmarking against 50 million items makes me suspect that minimal IO was required.

Now sure, sometimes that is exactly your use case. But for many interestingly sized problems, IO dominates.