Expand description
Query result caching with LRU eviction
This module provides an LRU (Least Recently Used) cache for query results, significantly improving performance for repeated queries.
§Performance Impact
- Cache hit: ~1-10μs (instant)
- Cache miss: Full search time (~1-10ms)
- Typical hit rate: 20-40% for production workloads
§Memory Usage
- Each cached entry: ~(key_size + result_size) bytes
- Default capacity: 1000 entries
- Configurable max size
Modules§
- early_
termination - Early termination optimization for k-NN search
Structs§
- Cache
Stats - Cache statistics
- Query
Cache - LRU cache for query results with TTL support
- Shared
Query Cache - Thread-safe LRU cache wrapper