[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
article

Adapting Radix Sort to the Memory Hierarchy

Published: 31 December 2001 Publication History

Abstract

We demonstrate the importance of reducing misses in the translation-lookaside buffer (TLB) for obtaining good performance on modern computer architectures. We focus on least-significantbit first (LSB) radix sort, standard implementations of which make many TLB misses. We give three techniques which simultaneously reduce cache and TLB misses for LSB radix sort: reducing working set size, explicit block transfer and pre-sorting. We note that: • All the techniques above yield algorithms whose implementations outperform optimised cache-tuned implementations of LSB radix sort and comparison-based sorting algorithms. The fastest running times are obtained by the pre-sorting approach and these are over twice as fast as optimised cache-tuned implementations of LSB radix sort and quicksort. Even the simplest optimisation, using the TLB size to guide the choice of radix in standard implementations of LSB radix sort, gives good improvements over cache-tuned algorithms. • One of the pre-sorting algorithms and explicit block transfer make few cache and TLB misses in the worst case. This is not true of standard implementations of LSB radix sort.We also apply these techniques to the problem of permuting an array of integers, and obtain gains of over 30% relative to the naive algorithm by using explicit block transfer.

Supplementary Material

TAR File (p7-rahman.tar)
The software suite accompanying the article; this is a Unix tar file, which includes the source code and the test files used in the article.
PS File (p7-rahman.ps)
TAR File (p7-rahman.tex.tar)

References

[1]
AGGARWAL, A. AND VITTER, J. S. 1988. The I/O complexity of sorting and related problems. Communications of the ACM 31, 1116-1127.]]
[2]
AHO, A. V., HOPCROFT, J. E., AND ULLMAN, J. D. 1974. The Design and Analysis of Computer Algorithms. Addison-Wesley.]]
[3]
CORMEN, T. H., LEISERSON, C. E., AND RIVEST, R. L. 1990. Introduction to Algorithms. MIT Press.]]
[4]
FRIEND, E. H. 1956. Sorting on electronic computer systems. Journal of the ACM 3, 134- 168.]]
[5]
FRIGO, M., LEISERSON, C. E., PROKOP, H., AND RAMACHANDRAN, S. 1999. Cache-oblivious algorithms. In Proc. 40th IEEE FOCS (1999), pp. 285-298.]]
[6]
GANNON, D. AND JALBY, W. 1987. The influence of memory hierarchy on algorithm organization: Programming FFTs on a vector multiprocessor. In L. H. JAMIESON, D. B. GANNON, AND R. J. DOUGLASS Eds., The Characteristics of Parallel Algorithms. MIT Press.]]
[7]
HANDY, J. 1998. The Cache Memory Handbook. Academic Press.]]
[8]
HENNESSY, J. L. AND PATTERSON, D. A. 1996. Computer Architecture: A Quantitative Approach (Second ed.). Morgan Kaufmann.]]
[9]
LADNER, R. E., FIX, J. D., AND LAMARCA, A. 1999. Cache performance analysis of traversals and random accesses. In Proc. 10th ACM-SIAM SODA (1999), pp. 613-622.]]
[10]
LAMARCA, A. AND LADNER, R. E. 1999. The influence of caches on the performance of sorting. Journal of Algorithms 31, 66-104. Preliminary version in Proc. 8th ACM-SIAM SODA, pp. 370-379, 1997.]]
[11]
MATIAS, Y., SEGAL, E., AND VITTER, J. S. 2000. Efficient bundle sorting. In Proceedings of the 11th Annual SIAM/ACM Symposium on Discrete Algorithms (2000).]]
[12]
MEHLHORN, K. AND SANDERS, P. 2000. Accessing multiple sequences through set-associative cache. Unpublished manuscript. Preliminary version in Proc. 26th ICALP, LNCS 1555, 1999.]]
[13]
MORET, B. AND SHAPIRO, U. 1994. An empirical assessment of algorithms for constructing a minimum spanning tree. In Computational Support for Discrete Mathematics, Volume 15 of DIMACS Monographs in Discrete Mathematics and Theoretical Computer Science, pp. 99-117. American Mathematical Society.]]
[14]
RAHMAN, N. AND RAMAN, R. 1999. Analysing cache effects in distribution sorting. Manuscript submitted for journal publication. 1999. Preliminary version in Algorithm Engineering: Proc. 3rd Workshop on Algorithm Engineering, Number 1668 in LNCS (1999), pp. 184-198.]]
[15]
SEN, S. AND CHATTERJEE, S. 2000. Towards a theory of cache-efficient algorithms (extended abstract). In Proc. 11th ACM-SIAM SODA (2000), pp. 829-838.]]
[16]
SLEATOR, D. D. AND TARJAN, R. E. 1985. Amortized efficiency of list update and paging rules. Communications of the ACM 28, 202-208.]]
[17]
Sun Microsystem. 1997. UltraSPARC User's Manual. Sun Microsystem.]]
[18]
VITTER, J. S. 2000. External memory algorithms and data structures: Dealing with MASSIVE data. To appear in ACM Computing Surveys.]]

Cited By

View all

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Journal of Experimental Algorithmics
ACM Journal of Experimental Algorithmics  Volume 6, Issue
2001
313 pages
ISSN:1084-6654
EISSN:1084-6654
DOI:10.1145/945394
Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 31 December 2001
Published in JEA Volume 6

Author Tags

  1. cache
  2. efficient sorting algorithms
  3. external-memory algorithms
  4. locality of reference
  5. memory hierarchy
  6. radix sort
  7. translation-lookaside buffer (TLB)

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)16
  • Downloads (Last 6 weeks)4
Reflects downloads up to 10 Dec 2024

Other Metrics

Citations

Cited By

View all

View Options

Login options

Full Access

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media