Summary: E∆cient Sorting Using Registers and Caches
Rajiv Wickremesinghe, Lars Arge, Jerey S. Chase, Jerey Scott Vitter
Duke University, Durham, NC, U.S.A.
Modern computer systems have increasingly complex memory systems. Common machine models
for algorithm analysis do not re
ect many of the features of these systems, e.g., large register sets,
lockup-free caches, cache hierarchies, associativity, cache line fetching, and streaming behavior.
Inadequate models lead to poor algorithmic choices and an incomplete understanding of algorithm
behavior on real machines.
A key step toward developing better models is to quantify the performance eects of features
ected in the models. This paper explores the eect of memory system features on sorting
performance. We introduce a new cache-conscious sorting algorithm, R-merge, which achieves
better performance in practice over algorithms that are superior in the theoretical models. R-
merge is designed to minimize memory stall cycles rather than cache misses by considering features
common to many system designs.
Program performance on today's computer systems is largely determined by in-
teractions with the memory system. While new compiler techniques can help to
improve a program's memory system behavior, algorithmic choices play a key role in
determining memory access patterns for data-intensive computation. Despite recent
progress, development of software that can perform well on on modern machines