Skip to main content

Using Compact Tries for Cache-Efficient Sorting of Integers

  • Conference paper
Experimental and Efficient Algorithms (WEA 2004)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 3059))

Included in the following conference series:

Abstract

The increasing latency between memory and processor speeds has made it imperative for algorithms to reduce expensive accesses to main memory. In earlier work, we presented cache-conscious algorithms for sorting strings, that have been shown to be almost two times faster than the previous algorithms, mainly due to better usage of the cache. In this paper, we propose two new algorithms, Burstsort and MEBurstsort, for sorting large sets of integer keys. Our algorithms use a novel approach for sorting integers, by dynamically constructing a compact trie which is used to allocate the keys to containers. These keys are then sorted within the cache. The new algorithms are simple, fast and efficient. We compare them against the best existing algorithms using several collections and data sizes. Our results show that MEBurstsort is up to 3.5 times faster than memory-tuned quicksort for 64-bit keys and up to 2.5 times faster for 32-bit keys. For 32-bit keys, on 10 of the 11 collections used, MEBurstsort was the fastest, whereas for 64-bit keys, it was the fastest for all collections.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Aho, A., Hopcroft, J.E., Ullman, J.D.: The Design and Analysis of Computer Algorithms. Addison-Wesley, Reading (1974)

    MATH  Google Scholar 

  2. Heinz, S., Zobel, J., Williams, H.E.: Burst tries: A fast, efficient data structure for string keys. ACM Transactions on Information Systems 20(2), 192–223 (2002)

    Article  Google Scholar 

  3. Hennessy, J.L., Patterson, D.A.: Computer Architecture: A Quantitative Approach. Morgan Kaufmann, San Mateo (2002)

    MATH  Google Scholar 

  4. Jimenez-Gonzalez, D., Navarro, J., Larriba-Pey, J.L.: The effect of local sort on parallel sorting algorithms. In: Proceedings of Parallel and Distributed Processing Workshop, Las Palmas de Gran Canaria, Spain (January 2002)

    Google Scholar 

  5. Jimenez-Gonzalez, D., Navarro, J., Larriba-Pey, J.L.: Cc-radix: a cache conscious sorting based on radix sort. In: Proceedings of the 11th Euromicro Workshop on Parallel, Distributed and Network-based processing (2003)

    Google Scholar 

  6. Knuth, D.E.: The Art of Computer Programming: Sorting and Searching, 2nd edn., vol. 3. Addison-Wesley, Massachusetts (1997)

    MATH  Google Scholar 

  7. LaMarca, A., Ladner, R.E.: The influence of caches on the performance of sorting. Jour. of Algorithms 31(1), 66–104 (1999)

    Article  MATH  MathSciNet  Google Scholar 

  8. Meyer, U., Sanders, P., Sibeyn, J.F. (eds.): Algorithms for Memory Hierarchies. LNCS, vol. 2625. Springer, Heidelberg (2003)

    MATH  Google Scholar 

  9. Rahman, N., Raman, R.: Analysing cache effects in distribution sorting. ACM Jour. of Experimental Algorithmics 5, 14 (2000)

    Article  MathSciNet  Google Scholar 

  10. Rahman, N., Raman, R.: Adapting radix sort to the memory hierarchy. ACM Jour. of Experimental Algorithmics 6(7) (2001)

    Google Scholar 

  11. Sedgewick, R.: Algorithms in C, 3rd edn. Addison-Wesley Longman, Reading (1998)

    MATH  Google Scholar 

  12. Sinha, R., Zobel, J.: Cache-conscious sorting of large sets of strings with dynamic tries. In: Ladner, R. (ed.) 5th ALENEX Workshop on Algorithm Engineering and Experiments, Baltimore, Maryland, January 2003, pp. 93–105 (2003)

    Google Scholar 

  13. Sinha, R., Zobel, J.: Efficient trie-based sorting of large sets of strings. In: Oudshoorn, M. (ed.) Proceedings of the Australasian Computer Science Conference, Adelaide, Australia, February 2003, pp. 11–18 (2003)

    Google Scholar 

  14. Wickremesinghe, R., Arge, L., Chase, J., Vitter, J.S.: Efficient sorting using registers and caches. ACM Jour. of Experimental Algorithmics 7(9) (2002)

    Google Scholar 

  15. Xiao, L., Zhang, X., Kubricht, S.A.: Improving memory performance of sorting algorithms. ACM Jour. of Experimental Algorithmics 5, 3 (2000)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2004 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Sinha, R. (2004). Using Compact Tries for Cache-Efficient Sorting of Integers. In: Ribeiro, C.C., Martins, S.L. (eds) Experimental and Efficient Algorithms. WEA 2004. Lecture Notes in Computer Science, vol 3059. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-24838-5_38

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-24838-5_38

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-22067-1

  • Online ISBN: 978-3-540-24838-5

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics