Add an optional LRU (Least Recently Used) cache for frequently accessed objects to improve performance during operations involving many files.
Context
Currently in src/config/mod.rs:176, there's a commented-out placeholder for future cache configuration:
// TODO: Add cache_size field when implementing object caching
// pub cache_size: usize, // Reserved for future LRU cache implementation
Proposed Changes
- Add
cache_size field to CoreConfig with sensible default (e.g., 1000 objects)
- Implement LRU cache in
src/storage/mod.rs using a library like lru crate
- Cache frequently accessed file hashes and metadata
- Add benchmarks to measure performance improvement
- Document cache behavior in user-facing docs
Benefits
- Faster repeated operations on same files (e.g., multiple status checks)
- Reduced disk I/O for recently accessed objects
- Configurable memory/performance tradeoff
Priority: Low (optimization)
Add an optional LRU (Least Recently Used) cache for frequently accessed objects to improve performance during operations involving many files.
Context
Currently in
src/config/mod.rs:176, there's a commented-out placeholder for future cache configuration:Proposed Changes
cache_sizefield toCoreConfigwith sensible default (e.g., 1000 objects)src/storage/mod.rsusing a library likelrucrateBenefits
Priority: Low (optimization)