We present a stable mergesort variant, Multiway Powersort, that exploits existing runs and finds nearly-optimal merging orders for k-way merges with negligible overhead. This builds on Powersort (Munro & Wild, ESA2018), which has recently replaced Timsort's suboptimal merge policy in the CPython reference implementation of Python, as well as in PyPy and further libraries. Multiway Powersort reduces the number of memory transfers, which increasingly determine the cost of internal sorting (as observed with Multiway Quicksort (Kushagra et al., ALENEX 2014; Aum\"uller & Dietzfelbinger, TALG 2016; Wild, PhD thesis 2016) and the inclusion of Dual-Pivot Quicksort in the Java runtime library). We demonstrate that our 4-way Powersort implementation can achieve substantial speedups over standard (2-way) Powersort and other stable sorting methods without compromising the optimally run-adaptive performance of Powersort.
翻译:我们提出了一个稳定的合并变体,即多way Powerort,它利用了现有的运行,发现 Kway 合并的订单几乎是最佳的,但间接费用微不足道。它建立在Powerort(Munro & Wrid, ESA2018)上,它最近取代了Timsort的亚最佳合并政策,在Python的CPython参考实施中,以及在PyPyPy和更多的图书馆中。多way Powerort减少了记忆传输的数量,这日益决定了内部排序的成本(多路快速转换(Kushagra等人,ALENEX,2014年;Aum\uller & Dietzfelbinger,TALG,2016年;Wild,PID Thesis,2016年),以及将双Pivot Quicksort纳入爪哇运行时图书馆)。我们证明,我们的四路强者实施可以大大加快标准(2way) 强力和其他稳定排序方法的成本,同时不损害强国的最佳运行性运行性表现。