Engineering a Cache-Oblivious Sorting Algorithm

Gerth Stølting Brodal, Rolf Fagerberg, and Kristoffer Vinther

Technical Report, ALCOMFT-TR-03-101, ALCOM-FT, 16 pages, November 2003.


The cache-oblivious model of computation is a two-level memory model with the assumption that the parameters of the model are unknown to the algorithms. A consequence of this assumption is that an algorithm efficient in the cache oblivious model is automatically efficient in a multi-level memory model.

Since the introduction of the cache-oblivious model by Frigo et al. in 1999, a number of algorithms and data structures in the model has been proposed and analyzed. However, less attention has been given to whether the nice theoretical proporities of cache-oblivious algorithms carry over into practice.

This paper is an algorithmic engineering study of cache-oblivious sorting. We investigate a number of implementation issues and parameters choices for the cache-oblivious sorting algorithm Lazy Funnelsort by empirical methods, and compare the final algorithm with Quicksort, the established standard for comparison based sorting, as well as with recent cache-aware proposals.

The main result is a carefully implemented cache-oblivious sorting algorithm, which we compare to the best implementation of Quicksort we can find, and find that it competes very well for input residing in RAM, and outperforms Quicksort for input on disk.

Online version

alcomft-tr-03-101.pdf (239 Kb)

BIBTEX entry

  author = "Gerth St{\o}lting Brodal and Rolf Fagerberg and Kristoffer Vinther",
  institution = "ALCOM-FT",
  month = "November",
  number = "ALCOMFT-TR-03-101",
  pages = "16",
  title = "Engineering a Cache-Oblivious Sorting Algorithm",
  year = "2003"