Skip to content

feat: add mtime-based file cache for collection files#7364

Draft
chirag-bruno wants to merge 3 commits intousebruno:mainfrom
chirag-bruno:feature/file-cache
Draft

feat: add mtime-based file cache for collection files#7364
chirag-bruno wants to merge 3 commits intousebruno:mainfrom
chirag-bruno:feature/file-cache

Conversation

@chirag-bruno
Copy link
Collaborator

Description

Implement a persistent file cache using LMDB to avoid re-parsing unchanged collection files, improving load times for large collections.

Key features:

  • LMDB-based cache with JSON encoding (no msgpack native deps)
  • mtime-based invalidation - automatically re-parses when files change
  • Version tracking to clear incompatible cache on upgrades
  • User preference to enable/disable caching (disabled by default)
  • Cache stats UI in Preferences > Cache tab
  • Prebuilt LMDB binaries for all platforms (darwin, win32, linux)

Cache integration:

  • On file add: check cache first, use cached data if mtime matches
  • On file change: update cache after parsing
  • On file delete: remove from cache
  • On app quit: flush and close database

Contribution Checklist:

  • I've used AI significantly to create this pull request
  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.

Publishing to New Package Managers

Please see here for more information.

Implement a persistent file cache using LMDB to avoid re-parsing unchanged
collection files, improving load times for large collections.

Key features:
- LMDB-based cache with JSON encoding (no msgpack native deps)
- mtime-based invalidation - automatically re-parses when files change
- Version tracking to clear incompatible cache on upgrades
- User preference to enable/disable caching (disabled by default)
- Cache stats UI in Preferences > Cache tab
- Prebuilt LMDB binaries for all platforms (darwin, win32, linux)

Cache integration:
- On file add: check cache first, use cached data if mtime matches
- On file change: update cache after parsing
- On file delete: remove from cache
- On app quit: flush and close database
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 4, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6f5073e2-98eb-4e95-b840-e05f2f946ff6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants