CacheKit Docs

High-performance cache policies and supporting data structures.

View the Project on GitHub OxidizeLabs/cachekit

Heap LFU (Priority Queue LFU)

Feature: policy-heap-lfu

Goal

Implement LFU using a heap to choose the minimum frequency victim, trading O(1) for simpler structure and O(log n) operations.

Core Data Structures

Typical heap LFU:

In cachekit, this is implemented in src/policy/heap_lfu.rs using lazy stale entries:

Operations

get(key)

insert(key, value)

Complexity & Overhead

Implementation Notes

References