Skip to main content
Log in

A theoretical comparison of LRU and LRU-K

  • Original Article
  • Published:
Acta Informatica Aims and scope Submit manuscript

Abstract

The paging algorithm Least Recently Used Second Last Request (LRU-2) was proposed for use in database disk buffering and shown experimentally to perform better than Least Recently Used (LRU). We compare LRU-2 and LRU theoretically, using both the standard competitive analysis and the newer relative worst order analysis. The competitive ratio for LRU-2 is shown to be 2k for cache size k, which is worse than LRU’s competitive ratio of k. However, using relative worst order analysis, we show that LRU-2 and LRU are comparable in LRU-2’s favor, giving a theoretical justification for the experimental results. Many of our results for LRU-2 also apply to its generalization, Least Recently Used Kth Last Request.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Albers S.: Online algorithms: a survey. Math. Programm. 97(1–2), 3–26 (2003)

    MATH  MathSciNet  Google Scholar 

  2. Borodin A., El-Yaniv R.: Online Computation and Competitive Analysis. Cambridge University Press, Cambridge (1998)

    MATH  Google Scholar 

  3. Borodin A., Irani S., Raghavan P., Schieber B.: Competitive paging with locality of reference. J. Comput. Syst. Sci. 50(2), 244–258 (1995)

    Article  MATH  MathSciNet  Google Scholar 

  4. Boyar, J., Ehmsen, M.R., Larsen, K.S.: Theoretical evidence for the superiority of LRU-2 over LRU for the paging problem. In: Proceedings of the 4th International Workshop on Approximation and Online Algorithms, vol. 4368 of Lecture Notes in Computer Science, pp. 95–107. Springer (2006)

  5. Boyar, J., Favrholdt, L.M.: The relative worst order ratio for on-line algorithms. ACM Trans. Algorithms, 3(2), (2007)

  6. Boyar J., Favrholdt L.M., Larsen K.S.: The relative worst order ratio applied to paging. J. Comput. Syst. Sci. 73(5), 818–843 (2007)

    Article  MATH  MathSciNet  Google Scholar 

  7. Boyar, J., Medvedev, P.: The relative worst order ratio applied to seat reservation. ACM Trans. Algorithms 4(4), (2008)

  8. Dorrigiv, R., Ehmsen, M.R., López-Ortiz, A.: Parameterized analysis of paging and list update algorithms. In: Proceedings of the 7th International Workshop on Approximation and Online Algorithms, vol. 5893 of Lecture Notes in Computer Science. Springer, 2010. Accepted for publication

  9. Dorrigiv R., López-Ortiz A.: A survey of performance measures for on-line algorithms. SIGACT News 36(3), 67–81 (2005)

    Article  Google Scholar 

  10. Dorrigiv R., López-Ortiz A., Munro J.I.: On the relative dominance of paging algorithms. Theor. Comput. Sci. 410, 3694–3701 (2009)

    Article  MATH  Google Scholar 

  11. Epstein, L., Favrholdt, L.M., Kohrt, J.S.: Comparing online algorithms for bin packing problems. J. Sched. Accepted for publication

  12. Epstein L., Favrholdt L.M., Kohrt J.S.: Separating scheduling algorithms with the relative worst order ratio. J. Comb. Optim. 12(4), 362–385 (2006)

    Article  MathSciNet  Google Scholar 

  13. Fiat, A., Rosen, Z.: Experimental studies of access graph based heuristics: beating the LRU standard? In: Proceedings of the 8th Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 63–72 (1997)

  14. Johnson, T., Shasha, D.: 2q: A low overhead high performance buffer management replacement algorithm. In: Proceedings of the 20th International Conference on Very Large Data Bases, pp. 439–450. Morgan Kaufmann Publishers Inc. (1994)

  15. Karlin A.R., Manasse M.S., Rudolph L., Sleator D.D.: Competitive snoopy caching. Algorithmica 3(1), 79–119 (1988)

    Article  MATH  MathSciNet  Google Scholar 

  16. Krumke S.O., De Paepe W., Rambau J., Stougie L.: Bincoloring. Theor. Comput. Sci. 407(1–3), 231–241 (2008)

    Article  MATH  MathSciNet  Google Scholar 

  17. Megiddo, N., Modha, D.S.: Arc: a self-tuning, low overhead replacement cache. In: Proceedings of the 2nd USENIX Conference on File and Storage Technologies, pp. 115–130. USENIX, (2003)

  18. O’Neil, E.J., O’Neil, P.E., Weikum, G.: The LRU-K page replacement algorithm for database disk buffering. In: Proceedings of the ACM SIGMOD International Conference on Management of Data, pp. 297–306 (1993)

  19. O’Neil E.J., O’Neil P.E., Weikum G.: An optimality proof of the LRU-K page replacement algorithm. J. ACM 46(1), 92–112 (1999)

    Article  MATH  MathSciNet  Google Scholar 

  20. Sleator D.D., Tarjan R.E.: Amortized efficiency of list update and paging rules. Commun. ACM 28(2), 202–208 (1985)

    Article  MathSciNet  Google Scholar 

  21. Weikum G., Hasse C., Mönkeberg A., Zabback P.: The comfort automatic tuning project. Inf. Syst. 19(5), 381–432 (1994)

    Article  Google Scholar 

  22. Young N.: The k-server dual and loose competitiveness for paging. Algorithmica 11(6), 525–541 (1994)

    Article  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Kim S. Larsen.

Additional information

A preliminary version of this paper appeared in the Proceedings of the 4th International Workshop on Approximation and Online Algorithms, volume 4368 of Lecture Notes in Computer Science, pages 95–107, Springer, 2006. This work was supported in part by the Danish Natural Science Research Council.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Boyar, J., Ehmsen, M.R., Kohrt, J.S. et al. A theoretical comparison of LRU and LRU-K. Acta Informatica 47, 359–374 (2010). https://doi.org/10.1007/s00236-010-0123-6

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00236-010-0123-6

Keywords

Navigation