工程就地(共享内存)排序算法
Engineering In-place (Shared-memory) Sorting Algorithms
摘要:
我们目前的排序算法,代表了最快的已知技术的输入大小,输入分布,数据类型,和机器的范围很广。速度优势的一部分是由于就地工作的特性。以前,就地特性通常意味着性能损失。我们的主要算法贡献是一个blockwise方法,就地数据分布,可证明是高速缓存效率。我们还并行化这种方法,考虑到动态负载均衡和内存局部性。我们的比较为基础的算法,就地超标量样本排序(IPS $^4$ o),结合了这种技术与无分支决策树。考虑到许多相同的元素的情况下,并通过动态适应的分布度,我们得到了一个非常强大的算法,优于最好的并行比较为基础的竞争对手的几乎三个因素。IPS $^4$ o在就地或非就地、并行或顺序设置中的性能也优于基于比较的最佳竞争产品。IPS $^4$ o在很多情况下甚至优于最好的整数排序算法。在其余的许多情况下(通常涉及近似均匀的输入分布,小键或顺序设置),我们的新就地基数排序器是最好的算法。在某种意义上,声称拥有“最好”的排序算法可以在许多论文中找到,但这些论文并不都是真的。因此,我们的结论是基于广泛的实验,涉及21个国家的最先进的排序代码,6个数据类型,10个输入分布,4台机器,4个内存分配策略,和输入大小变化超过7个数量级的交叉产品的很大一部分。这证实了我们的算法的强大性能,同时揭示了在相关出版物中报告的具体测量集之外的许多竞争对手的主要性能问题。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。