Parallel Integer Sort: Theory and Practice
Xiaojun Dong, Laxman Dhulipala, Yan Gu, Yihan Sun
TL;DR
The paper tackles parallel integer sorting by bridging theory and practice. It introduces DovetailSort (DTSort), a stable, MSD-based algorithm that detects and leverages duplicate keys via sampling and heavy-light partitioning, then interleaves heavy and light buckets with a dovetail merge. The authors prove that a broad class of practical MSD IS algorithms achieves $O(n\sqrt{\log r})$ work and polylogarithmic-to-tilde span, with DTSort attaining $O(n\sqrt{\log r})$ work and $\tilde{O}(2^{\sqrt{\log r}})$ span, and even $O(n)$ work for certain distributions. Empirically, DTSort matches or outperforms state-of-the-art parallel IS and comparison sorts on synthetic and real-world data, especially with many duplicates, while maintaining scalability up to hundreds of cores. Overall, the work offers both a solid theoretical foundation and a practical, robust sorter for large-scale integer data.
Abstract
Integer sorting is a fundamental problem in computer science. This paper studies parallel integer sort both in theory and in practice. In theory, we show tighter bounds for a class of existing practical integer sort algorithms, which provides a solid theoretical foundation for their widespread usage in practice and strong performance. In practice, we design a new integer sorting algorithm, \textsf{DovetailSort}, that is theoretically-efficient and has good practical performance. In particular, \textsf{DovetailSort} overcomes a common challenge in existing parallel integer sorting algorithms, which is the difficulty of detecting and taking advantage of duplicate keys. The key insight in \textsf{DovetailSort} is to combine algorithmic ideas from both integer- and comparison-sorting algorithms. In our experiments, \textsf{DovetailSort} achieves competitive or better performance than existing state-of-the-art parallel integer and comparison sorting algorithms on various synthetic and real-world datasets.
