Your code is fast – if you're lucky
Summary
This article examines a branchless Quicksort implementation that uses sorting networks and heavy macro-based optimizations. It discusses how modern compilers, especially Clang, can replace branches with branchless instructions and compares performance against std::sort, including a rewritten, more compact version of the code and observed cross-compiler differences.