Advertisement

Algorithmica

, Volume 61, Issue 2, pp 463–505 | Cite as

The Cost of Cache-Oblivious Searching

  • Michael A. Bender
  • Gerth Stølting Brodal
  • Rolf Fagerberg
  • Dongdong Ge
  • Simai He
  • Haodong Hu
  • John Iacono
  • Alejandro López-Ortiz
Article

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.

Keywords

Cache-oblivious B-tree Cache-oblivious searching van Emde Boas layout 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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) Google Scholar
  2. 2.
    Aggarwal, A., Vitter, J.S.: The input/output complexity of sorting and related problems. Commun. ACM 31(9), 1116–1127 (1988) MathSciNetCrossRefGoogle Scholar
  3. 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) Google Scholar
  4. 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) Google Scholar
  5. 5.
    Alpern, B., Carter, L., Feig, E., Selker, T.: The uniform memory hierarchy model of computation. Algorithmica 12(2–3), 72–109 (1994) MathSciNetMATHCrossRefGoogle Scholar
  6. 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. 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) Google Scholar
  8. 8.
    Andrews, M., Bender, M.A., Zhang, L.: New algorithms for the disk scheduling problem. Algorithmica 32(2), 277–301 (2002) MathSciNetMATHCrossRefGoogle Scholar
  9. 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) Google Scholar
  10. 10.
    Bayer, R., McCreight, E.: Organization and maintenance of large ordered indexes. Acta Inform. 1, 173–189 (1972) CrossRefGoogle Scholar
  11. 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) CrossRefGoogle Scholar
  12. 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. 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) Google Scholar
  14. 14.
    Bender, M.A., Duan, Z., Iacono, J., Wu, J.: A locality-preserving cache-oblivious dynamic dictionary. J. Algorithms 3(2), 115–136 (2004) MathSciNetCrossRefGoogle Scholar
  15. 15.
    Bender, M.A., Demaine, E.D., Farach-Colton, M.: Cache-oblivious B-trees. SIAM J. Comput. 35(2), 341–358 (2005) MathSciNetMATHCrossRefGoogle Scholar
  16. 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. 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) Google Scholar
  18. 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) Google Scholar
  19. 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. 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) CrossRefGoogle Scholar
  21. 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) Google Scholar
  22. 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) Google Scholar
  23. 23.
    Comer, D.: The ubiquitous B-tree. ACM Computing Surveys 11(2), 121–137 (1979) MATHCrossRefGoogle Scholar
  24. 24.
    Demaine, E.D.: Cache-oblivious algorithms and data structures. In: Lecture Notes from the EEF Summer School on Massive Data Sets (2002) Google Scholar
  25. 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. 26.
    Franceschini, G., Grossi, R.: Optimal implicit dictionaries over unbounded universes. Theory Comput. Syst. 39(2), 321–345 (2006) MathSciNetMATHCrossRefGoogle Scholar
  27. 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) Google Scholar
  28. 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) Google Scholar
  29. 29.
    Knuth, D.E.: The Art of Computer Programming: Fundamental Algorithms, vol. 1, 3rd edn. Addison-Wesley, Reading (1997) MATHGoogle Scholar
  30. 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) CrossRefGoogle Scholar
  31. 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) Google Scholar
  32. 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. 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 MathSciNetMATHCrossRefGoogle Scholar
  34. 34.
    Prokop, H.: Cache oblivious algorithms. Master’s thesis, Department of Electrical Engineering and Computer Science, Massachusetts Institute of Technology, June 1999 Google Scholar
  35. 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) Google Scholar
  36. 36.
    Ruemmler, C., Wilkes, J.: An introduction to disk drive modeling. IEEE Computer 27(3), 17–29 (1994) Google Scholar
  37. 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. 38.
    Sen, S., Chatterjee, S., Dumir, N.: Towards a theory of cache-efficient algorithms. J. Assoc. Comput. Mach. 49(6), 828–858 (2002) MathSciNetGoogle Scholar
  39. 39.
    Singleton, R.C.: An algorithm for computing the mixed radix Fast Fourier Transform. IEEE Trans. Audio Electroacoust. AU-17(2), 93–103 (1969) CrossRefGoogle Scholar
  40. 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) Google Scholar
  41. 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) MATHCrossRefGoogle Scholar
  42. 42.
    Vitter, J.S.: External memory algorithms and data structures: dealing with massive data. ACM Comput. Surv. 33(2) (2001) Google Scholar
  43. 43.
    Vitter, J.S., Shriver, E.A.M.: Algorithms for parallel memory I: Two-level memories. Algorithmica 12(2–3), 110–147 (1994) MathSciNetMATHCrossRefGoogle Scholar
  44. 44.
    Vitter, J.S., Shriver, E.A.M.: Algorithms for parallel memory II: Hierarchical multilevel memories. Algorithmica 12(2–3), 148–169 (1994) MathSciNetMATHCrossRefGoogle Scholar

Copyright information

© Springer Science+Business Media, LLC 2010

Authors and Affiliations

  • Michael A. Bender
    • 1
    • 2
  • Gerth Stølting Brodal
    • 3
  • Rolf Fagerberg
    • 4
  • Dongdong Ge
    • 5
  • Simai He
    • 6
  • Haodong Hu
    • 7
  • John Iacono
    • 8
  • Alejandro López-Ortiz
    • 9
  1. 1.Department of Computer ScienceStony Brook UniversityStony BrookUSA
  2. 2.Tokutek Inc.LexingtonUSA
  3. 3.MADALGO—Center for Massive Data Algorithmics, a Center of the Danish National Research Foundation, Department of Computer ScienceAarhus UniversityÅrhus CDenmark
  4. 4.Department of Mathematics and Computer ScienceUniversity of Southern DenmarkOdense MDenmark
  5. 5.Department of Management Science and Engineering, Antai School of Economics and ManagementShanghai JiaoTong UniversityShanghaiChina
  6. 6.Department of System Engineering and Engineering ManagementChinese University of HongkongHongkongChina
  7. 7.Networking and Device Connectivity at Windows DivisionMicrosoftRedmondUSA
  8. 8.Department of Computer and Information SciencePolytechnic UniversityBrooklynUSA
  9. 9.School of Computer ScienceUniversity of WaterlooWaterlooCanada

Personalised recommendations