↓ Skip to main content

“In common patterns, pdqsort is often faster (i.e. 10x faster in sorted slices).”

zhangyunhao116github.com ↗

Sorting an already sorted slice dropped from 28.2 microseconds to 3.3. Real data is rarely random, and the old algorithm acted like it always was. The commit borrows from the C++ and Rust implementations. Go took a decade to stop paying full price for sorting sorted data.