The Cost of Cache-Oblivious Searching | Algorithmica Skip to main content
Log in

The Cost of Cache-Oblivious Searching

  • Published:
Algorithmica Aims and scope Submit manuscript

Abstract

This paper gives tight bounds on the cost of cache-oblivious searching. The paper shows that no cache-oblivious search structure can guarantee a search performance of fewer than lg elog  B N memory transfers between any two levels of the memory hierarchy. This lower bound holds even if all of the block sizes are limited to be powers of 2. The paper gives modified versions of the van Emde Boas layout, where the expected number of memory transfers between any two levels of the memory hierarchy is arbitrarily close to [lg e+O(lg lg B/lg B)]log  B N+O(1). This factor approaches lg e≈1.443 as B increases. The expectation is taken over the random placement in memory of the first element of the structure.

Because searching in the disk-access machine (DAM) model can be performed in log  B N+O(1) block transfers, this result establishes a separation between the (2-level) DAM model and cache-oblivious model. The DAM model naturally extends to k levels. The paper also shows that as k grows, the search costs of the optimal k-level DAM search structure and the optimal cache-oblivious search structure rapidly converge. This result demonstrates that for a multilevel memory hierarchy, a simple cache-oblivious structure almost replicates the performance of an optimal parameterized k-level DAM structure.

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

Access this article

Subscribe and save

Springer+ Basic
¥17,985 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Price includes VAT (Japan)

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Agarwal, P., Arge, L., Danner, A., Holland-Minkley, B.: Cache-oblivious data structures for orthogonal range searching. In: Proc. 19th ACM Symp. on Comp. Geom. (SOCG), pp. 237–245 (2003)

  2. Aggarwal, A., Vitter, J.S.: The input/output complexity of sorting and related problems. Commun. ACM 31(9), 1116–1127 (1988)

    Article  MathSciNet  Google Scholar 

  3. Aggarwal, A., Alpern, B., Chandra, A.K., Snir, M.: A model for hierarchical memory. In: Proc. of the 19th Ann. ACM Symp. on Theory of Computing (STOC), pp. 305–314 (1987)

  4. Aggarwal, A., Chandra, A.K., Snir, M.: Hierarchical memory with block transfer. In: Proc. of the 28th Annual IEEE Symp. on Foundations of Computer Science (FOCS), pp. 204–216 (1987)

  5. Alpern, B., Carter, L., Feig, E., Selker, T.: The uniform memory hierarchy model of computation. Algorithmica 12(2–3), 72–109 (1994)

    Article  MathSciNet  MATH  Google Scholar 

  6. Alstrup, S., Bender, M.A., Demaine, E.D., Farach-Colton, M., Munro, J.I., Rauhe, T., Thorup, M.: Efficient tree layout in a multilevel memory hierarchy (2002). arXiv:cs.DS/0211010

  7. Andrews, M., Bender, M.A., Zhang, L.: New algorithms for the disk scheduling problem. In: Proc. of the 37th Ann. Symp. on Foundations of Computer Science (FOCS), pp. 580–589 (1996)

  8. Andrews, M., Bender, M.A., Zhang, L.: New algorithms for the disk scheduling problem. Algorithmica 32(2), 277–301 (2002)

    Article  MathSciNet  MATH  Google Scholar 

  9. Barve, R.D., Vitter, J.S.: A theoretical framework for memory-adaptive algorithms. In: Proc. of the 40th Ann. Symp. on Foundations of Computer Science (FOCS), pp. 273–284 (1999)

  10. Bayer, R., McCreight, E.: Organization and maintenance of large ordered indexes. Acta Inform. 1, 173–189 (1972)

    Article  Google Scholar 

  11. Bender, M., Cole, R., Raman, R.: Exponential structures for cache-oblivious algorithms. In: Proc. 29th International Colloquium on Automata, Languages, and Programming (ICALP). LNCS, vol. 2380, pp. 195–207. Springer, Berlin (2002)

    Chapter  Google Scholar 

  12. Bender, M., Demaine, E., Farach-Colton, M.: Efficient tree layout in a multilevel memory hierarchy. In: Proc. 10th Annual European Symp. on Algorithms (ESA). LNCS, vol. 2461, pp. 165–173. Springer, Berlin (2002)

    Google Scholar 

  13. Bender, M.A., Brodal, G.S., Fagerberg, R., Ge, D., He, S., Hu, H., Iacono, J., López-Ortiz, A.: The cost of cache-oblivious searching. In: Proc. 44th Ann. Symp. on Foundations of Computer Science (FOCS), pp. 271–280 (2003)

  14. Bender, M.A., Duan, Z., Iacono, J., Wu, J.: A locality-preserving cache-oblivious dynamic dictionary. J. Algorithms 3(2), 115–136 (2004)

    Article  MathSciNet  Google Scholar 

  15. Bender, M.A., Demaine, E.D., Farach-Colton, M.: Cache-oblivious B-trees. SIAM J. Comput. 35(2), 341–358 (2005)

    Article  MathSciNet  MATH  Google Scholar 

  16. Bender, M.A., Fineman, J.T., Gilbert, S., Kuszmaul, B.C.: Concurrent cache-oblivious B-trees. In: SPAA ’05: Proceedings of the Seventeenth Annual ACM Symposium on Parallelism in Algorithms and Architectures, pp. 228–237. ACM, New York (2005)

    Google Scholar 

  17. Bender, M.A., Farach-Colton, M., Kuszmaul, B.: Cache-oblivious string B-trees. In: Proceedings of the 25th ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems (PODS), pp. 233–242 (2006)

  18. Bender, M.A., Farach-Colton, M., Fineman, J.T., Fogel, Y.R., Kuszmaul, B.C., Nelson, J.: Cache-oblivious streaming B-trees. In: SPAA, pp. 81–92 (2007)

  19. Brodal, G.S., Fagerberg, R.: Funnel heap—a cache oblivious priority queue. In: Proc. 13th Ann. International Symp. on Algorithms and Computation (ISAAC). LNCS, vol. 2518, pp. 219–228. Springer, Berlin (2002)

    Google Scholar 

  20. Brodal, G.S., Fagerberg, R.: Cache oblivious distribution sweeping. In: Proc. 29th International Colloquium on Automata, Languages, and Programming (ICALP). LNCS, vol. 2380, pp. 426–438. Springer, Berlin (2002)

    Chapter  Google Scholar 

  21. Brodal, G.S., Fagerberg, R., Jacob, R.: Cache oblivious search trees via binary trees of small height. In: Proc. 13th Ann. ACM-SIAM Symp. on Discrete Algorithms (SODA), pp. 39–48 (2002)

  22. Brodal, G.S., Demaine, E.D., Fineman, J.T., Iacono, J., Langerman, S., Munro, J.I.: Cache-oblivious dynamic dictionaries with optimal update/query tradeoff. In: Proc. 21st Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 1448–1456 (2010)

  23. Comer, D.: The ubiquitous B-tree. ACM Computing Surveys 11(2), 121–137 (1979)

    Article  MATH  Google Scholar 

  24. Demaine, E.D.: Cache-oblivious algorithms and data structures. In: Lecture Notes from the EEF Summer School on Massive Data Sets (2002)

  25. Franceschini, G., Grossi, R.: Optimal worst-case operations for implicit cache-oblivious search trees. In: Proc. 8th International Workshop on Algorithms and Data Structures (WADS). LNCS, vol. 2748, pp. 114–126. Springer, Berlin (2003)

    Google Scholar 

  26. Franceschini, G., Grossi, R.: Optimal implicit dictionaries over unbounded universes. Theory Comput. Syst. 39(2), 321–345 (2006)

    Article  MathSciNet  MATH  Google Scholar 

  27. Frigo, M., Leiserson, C.E., Prokop, H., Ramachandran, S.: Cache-oblivious algorithms. In: 40th Ann. Symp. on Foundations of Computer Science (FOCS), pp. 285–297 (1999)

  28. Hong, J.-W., Kung, H.T.: I/O complexity: The red-blue pebble game. In: Proc. of the 13th Ann. ACM Symp. on Theory of Computation (STOC), pp. 326–333 (1981)

  29. Knuth, D.E.: The Art of Computer Programming: Fundamental Algorithms, vol. 1, 3rd edn. Addison-Wesley, Reading (1997)

    MATH  Google Scholar 

  30. Kumar, P.: Cache oblivious algorithms. In: Meyer, U., Sanders P., Sibeyn, J. (eds.) Algorithms for Memory Hierarchies. LNCS, vol. 2625, pp. 193–212. Springer, Berlin (2003)

    Chapter  Google Scholar 

  31. Ladner, R.E., Fix, J.D., LaMarca, A.: Cache performance analysis of traversals and random accesses. In: Proc. of the Tenth Ann. ACM-SIAM Symp. on Discrete Algorithms (SODA), pp. 613–622 (1999)

  32. Ladner, R., Fortna, R., Nguyen, B.-H.: A comparison of cache aware and cache oblivious static search trees using program instrumentation. In: Algorithm Design to Robust and Efficient Software. LNCS, vol. 2547, pp. 78–92. Springer, Berlin (2002)

    Google Scholar 

  33. LaMarca, A., Ladner, R.E.: The influence of caches on the performance of sorting. J. Algorithms 31(1), 66–104 (1999). An earlier version appear in SODA 97

    Article  MathSciNet  MATH  Google Scholar 

  34. Prokop, H.: Cache oblivious algorithms. Master’s thesis, Department of Electrical Engineering and Computer Science, Massachusetts Institute of Technology, June 1999

  35. Rahman, N., Cole, R., Raman, R.: Optimised predecessor data structures for internal memory. In: Proc. 5th Int. Workshop on Algorithm Engineering (WAE), vol. 2141, pp. 67–78 (2001)

  36. Ruemmler, C., Wilkes, J.: An introduction to disk drive modeling. IEEE Computer 27(3), 17–29 (1994)

    Google Scholar 

  37. Savage, J.E.: Extending the Hong-Kung model to memory hierarchies. In: Proc. of the 1st Ann. International Conference on Computing and Combinatorics. LNCS, vol. 959, pp. 270–281. Springer, Berlin (1995)

    Google Scholar 

  38. Sen, S., Chatterjee, S., Dumir, N.: Towards a theory of cache-efficient algorithms. J. Assoc. Comput. Mach. 49(6), 828–858 (2002)

    MathSciNet  Google Scholar 

  39. Singleton, R.C.: An algorithm for computing the mixed radix Fast Fourier Transform. IEEE Trans. Audio Electroacoust. AU-17(2), 93–103 (1969)

    Article  Google Scholar 

  40. van Emde Boas, P.: Preserving order in a forest in less than logarithmic time. In: Proc. of the 16th Ann. Symp. on Foundations of Computer Science (FOCS), pp. 75–84 (1975)

  41. van Emde Boas, P.: Preserving order in a forest in less than logarithmic time and linear space. Inf. Process. Lett. 6(3), 80–82 (1977)

    Article  MATH  Google Scholar 

  42. Vitter, J.S.: External memory algorithms and data structures: dealing with massive data. ACM Comput. Surv. 33(2) (2001)

  43. Vitter, J.S., Shriver, E.A.M.: Algorithms for parallel memory I: Two-level memories. Algorithmica 12(2–3), 110–147 (1994)

    Article  MathSciNet  MATH  Google Scholar 

  44. Vitter, J.S., Shriver, E.A.M.: Algorithms for parallel memory II: Hierarchical multilevel memories. Algorithmica 12(2–3), 148–169 (1994)

    Article  MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Alejandro López-Ortiz.

Additional information

An earlier version of this paper in extended abstract form appears in the Proceedings of the 44th Annual Symposium on the Foundations of Computer Science (FOCS), pages 271–280, 2003 [13].

M.A. Bender was supported in part by NSF Grants CCF 0621439/0621425, CCF 0540897/05414009, CCF 0634793/0632838, CNS 0627645, and CCF 0937822 and by DOE Grant DE-FG02-08ER25853.

G.S. Brodal was partially supported by the Future and Emerging Technologies programme of the EU under contract number IST-1999-14186 (ALCOM-FT) and the Carlsberg Foundation (contract number ANS-0257/20).

J. Iacono was supported in part by NSF grants CCF-0430849 and OISE-0334653 and by an Alfred P. Sloan Fellowship.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Bender, M.A., Brodal, G.S., Fagerberg, R. et al. The Cost of Cache-Oblivious Searching. Algorithmica 61, 463–505 (2011). https://doi.org/10.1007/s00453-010-9394-0

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00453-010-9394-0

Keywords

Navigation