Article

A C++ Quicksort Faster Than std::sort

chkas ·Lobsters ·Published 2026-11-09

blqsort is a very fast quicksort algorithm. I am not aware of any other general-purpose comparison-based sorting algorithm that is faster on random data. Only specialized SIMD-based algorithms are generally faster when dealing with small…

From the article

blqsort is a very fast quicksort algorithm. I am not aware of any other general-purpose comparison-based sorting algorithm that is faster on random data. Only specialized SIMD-based algorithms are generally faster when dealing with small primitive data types.

The main ideas are branchless partitioning, sorting networks for small partitions and robust pivot selection.

The implementation is available on GitHub under the MIT license. There is also a C version of it, including multithreaded versions, each as a single header file.


Share this resource


Discovered 2026-11-10 Source Lobsters Archive 2026-11 →