We present sorting algorithms that represent the fastest known techniques for a wide range of input sizes, input distributions, data types, and machines. A part of the speed advantage is due to the feature to work in-place. Previously, the in-place feature often implied performance penalties. Our main algorithmic contribution is a blockwise approach to in-place data distribution that is provably cache-efficient. We also parallelize this approach taking dynamic load balancing and memory locality into account. Our comparison-based algorithm, In-place Superscalar Samplesort (IPS$^4$o), combines this technique with branchless decision trees. By taking cases with many equal elements into account and by adapting the distribution degree dynamically, we obtain a highly robust algorithm that outperforms the best in-place parallel comparison-based competitor by almost a factor of three. IPS$^4$o also outperforms the best comparison-based competitors in the in-place or not in-place, parallel or sequential settings. IPS$^4$o even outperforms the best integer sorting algorithms in a wide range of situations. In many of the remaining cases (often involving near-uniform input distributions, small keys, or a sequential setting), our new in-place radix sorter turns out to be the best algorithm. Claims to have the, in some sense, "best" sorting algorithm can be found in many papers which cannot all be true. Therefore, we base our conclusions on extensive experiments involving a large part of the cross product of 21 state-of-the-art sorting codes, 6 data types, 10 input distributions, 4 machines, 4 memory allocation strategies, and input sizes varying over 7 orders of magnitude. This confirms the robust performance of our algorithms while revealing major performance problems in many competitors outside the concrete set of measurements reported in the associated publications.
翻译:我们提出的算法代表了各种输入大小、输入分布、数据类型和机器方面已知的最快的技术。 速度优势的一部分是由于在现场工作的特性。 以前, 本地特性往往意味着性能处罚。 我们的主要算法贡献是一种对本地数据分布的阻断性方法, 它可以让人看到缓存效率。 我们还平行地利用动态负载平衡和内存位置来计算这一方法。 我们的比较算法, 即超大卡路里样本( IPS$4$o), 将这一技术与没有分支的决策树结合起来。 部分速度优势是由于在现场工作特点。 之前, 本地特性特征往往意味着性能。 IPS$4$o 也比本地或非本地的顶级竞争对手要强。 我们的超级卡路里样样样样样样样样样样样样样样样样样样样样样样样样样样样样( IPS%4$4$4$o), 使得我们最精确的算法化的算法值比起来, 接近于正常的计算, 等样样样样样样样样的内, 。