Skip to content

Implement LRU object cache for deduplication performance #1

@UtsavBalar1231

Description

@UtsavBalar1231

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

  1. Add cache_size field to CoreConfig with sensible default (e.g., 1000 objects)
  2. Implement LRU cache in src/storage/mod.rs using a library like lru crate
  3. Cache frequently accessed file hashes and metadata
  4. Add benchmarks to measure performance improvement
  5. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpriority: mediumMedium priority - normal timeline

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions