Multiway Powersort

William Cawley Gelling, Markus E. Nebel, Benjamin Smith, Sebastian Wild
9/14/2022
cs.DS

Official code: sebawild/powersort (30 stars, C++, MIT, last commit 2025-01-07).

Abstract

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.

Show full abstract

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üller & 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.

View on arXivView PDF

Code Implementations(1)

sebawild/powersortOfficial100%
MIT

C++ implementations of Powersort and 4-way Powersort

305C++, PythonSep 14, 20221 years agoMIT

Similar Papers

Cite this paper

@article{gelling2022multiway,
  title  = {Multiway Powersort},
  author = {William Cawley Gelling and Markus E. Nebel and Benjamin Smith and Sebastian Wild},
  year   = {2022},
  eprint = {2209.06909},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2209.06909}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2209.06909.svg)](https://codeofpaper.com/paper/2209.06909)

Discussion