Powersort (Munro & Wild, ESA2018) has recently replaced Timsort's suboptimal merge policy in the CPython reference implementation of Python, as well as in PyPy and further libraries. 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. 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, memory transfers increasingly determine the cost of internal sorting. 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.
翻译:Powerort (Munro & Wrid, ESA2018) 最近取代了提姆索尔特在CPython参考文献实施中的亚最佳合并政策, 以及PyPy 和其他图书馆。 我们展示了一个稳定的合并变体, 即多威强, 它利用了现有的运行, 发现 kway 合并的订单几乎最佳。 正如多路快速索尔特( Kushagra et al., ALENEX, 2014); Aum\“ uller & Dietzfelbinger, TALG 2016; 野生, Prid, Prid, Pricsis 2016) 以及将二维特 Quicksort 纳入 Java 运行时图书馆, 记忆传输越来越决定了内部排序的成本。 我们证明, 我们的四维强权者实施可以在不损及Powerort最佳运行适应性业绩的情况下在标准( 2way) 和其他稳定排序方法上实现大幅加速。