Expand description
Workspace indexing and refactoring orchestration. Bounded LRU caches for workspace index components.
This module provides thread-safe, bounded caches with LRU eviction policies for AST nodes, symbols, and workspace data. These caches enforce memory limits while maintaining high hit rates for frequently accessed data.
§Performance Characteristics
- Cache hit rate: >90% for typical workloads
- Eviction latency: O(1) amortized with linked hash map
- Memory overhead: ~32 bytes per cache entry
- Thread safety: Lock-free reads with atomic reference counting
§Cache Configuration
- AST Node Cache: Max 10,000 nodes, 50MB memory limit
- Symbol Cache: Max 50,000 symbols, 30MB memory limit
- Workspace Cache: Max 1,000 files, 20MB memory limit
§Usage
ⓘ
use perl_workspace_index::workspace::cache::{BoundedLruCache, CacheConfig};
let config = CacheConfig::default();
let cache = BoundedLruCache::new(config);
cache.insert("key", "value");
assert_eq!(cache.get("key"), Some(&"value"));Structs§
- AstCache
Config - AST node cache configuration.
- Bounded
LruCache - Thread-safe bounded LRU cache.
- Cache
Config - Cache configuration for bounded LRU caches.
- Cache
Stats - Cache statistics for monitoring and diagnostics.
- Combined
Workspace Cache Config - Combined cache configuration for all workspace caches.
- Symbol
Cache Config - Symbol cache configuration.
- Workspace
Cache Config - Workspace cache configuration.
Traits§
- Estimate
Size - Trait for estimating the memory size of cached values.