MRU (Most Recently Used) Cache
MRU evicts the most recently used items, suitable for scenarios with strong temporal locality.
Overview
MRU (Most Recently Used) is based on the principle of temporal locality, assuming that recently accessed data will not be accessed again. When the cache is full, it evicts the most recently used data.
Features
- Hit Rate: 80%
- Memory Usage: Low
- Concurrency: Medium
- Implementation Complexity: Simple
Use Cases
- Temporal locality
- Sequential access patterns
- Cache warmup
- Scan-style access
Quick Start
Installation
Basic Usage
API Reference
Constructors
Main Methods
Performance Characteristics
- Time Complexity:
- Set: O(1)
- Get: O(1)
- Delete: O(1)
- Space Complexity: O(n), where n is cache capacity
Best Practices
- Sequential access scenarios: MRU is suitable for scan-style access
- Cache warmup: During warmup phase, MRU can quickly evict warmup data
- Avoid frequent access: Not suitable for scenarios where the same data is accessed frequently