Monday, November 23, 2015

Understanding Adaptive Replacement Cache (ARC) through a simple Python code

Hello,

Recently, I had a rather annoying problem of understanding Adaptive Replacement Cache (ARC) algorithm. ARC is an efficient, self-tuning, and patented cache algorithm proposed by folks at IBM about ten years ago. It is much more efficient than LRU and requires just minimal additional overhead. Nevertheless, this cache algorithm is a bit complicated to follow. So I decided to implement it by myself using Python. Note that there is already a nice Python code of ARC. However, that code utilizes wrapper and decoration functions, being quite a bit complex. My code is straightforward and may be more understandable to some Python beginners.

Warning: The code is only for educational purposes. The ARC algorithm is protected by US patent law.

Link to my code on GitHub
Code

Now you know what to do next. Have fun! :)

-
Saran