Cache eviction algorithms are used widely in operating systems, databases and other systems that use caches to speed up execution by caching data that is used by the application. There are many policies such as MRU (Most Recently Used), MFU (Most Frequently Used), LRU (Least Recently Used) and LFU (Least Frequently Used) which each have their advantages and drawbacks and are hence used in specific scenarios. By far, the most widely used algorithm is LRU, both for its $O(1)$ speed of operation as well as its close resemblance to the kind of behaviour that is expected by most applications. The LFU algorithm also has behaviour desirable by many real world workloads. However, in many places, the LRU algorithm is is preferred over the LFU algorithm because of its lower run time complexity of $O(1)$ versus $O(\log n)$. We present here an LFU cache eviction algorithm that has a runtime complexity of $O(1)$ for all of its operations, which include insertion, access and deletion(eviction).
翻译:缓冲驱逐算法在操作系统、数据库和其他系统中广泛使用,这些算法使用缓存加快执行速度,方法是应用程序使用的缓存数据,有许多政策,如MRU(最新使用)、MFU(最经常使用)、LRU(最近使用)、LFU(最经常使用)和LFU(最经常使用),它们各自都有其优点和缺点,因此在特定情况下使用。迄今为止,最广泛使用的缓存算法是LRU,其运作速度为1美元,与大多数应用程序所预期的行为类型十分相似。LFU算法也有许多实际世界工作量所需要的行为。然而,在许多地方,LFU算法因其运行时间复杂性较低,为1美元,比美元(最低经常使用)美元(最低)。我们在这里提出一个LFU缓存驱逐算法,其所有操作的运行时间复杂性为1美元,其中包括插入、访问和删除(避免)。