Module slru

Source
Expand description

Segmented LRU (SLRU) cache implementation.

Provides a fixed-size cache that uses a segmented approach to evict items based on their usage patterns. This is useful for scenarios where certain items are accessed more frequently than others. Segmented Least Recently Used Cache Implementation.

The SLRU (Segmented LRU) cache divides the cache into two segments:

  • Probationary segment: Where new entries are initially placed
  • Protected segment: Where frequently accessed entries are promoted to

This implementation provides better performance for scan-resistant workloads compared to standard LRU, as it protects frequently accessed items from being evicted by one-time scans through the data.

Structsยง

SlruCache
An implementation of a Segmented Least Recently Used (SLRU) cache.