Skip to content

perf: skip unchanged files via mtime checks and wrap inserts in transaction#324

Open
olyashok wants to merge 1 commit intotobi:mainfrom
cellect-ai:perf/mtime-checks-transaction
Open

perf: skip unchanged files via mtime checks and wrap inserts in transaction#324
olyashok wants to merge 1 commit intotobi:mainfrom
cellect-ai:perf/mtime-checks-transaction

Conversation

@olyashok
Copy link

@olyashok olyashok commented Mar 8, 2026

Summary

  • Skip re-reading files whose mtime hasn't changed since last index, reducing unnecessary disk I/O
  • Wrap all database inserts/updates in a single transaction for a significant write performance improvement
  • Update findActiveDocument to include modified_at in returned structure
  • Add logging for number of files skipped

No functional changes — pure performance improvement to the indexing path.

Test plan

  • Run qmd index on a large directory, verify files with unchanged mtime are skipped on subsequent runs
  • Verify index results are identical to pre-patch behavior

🤖 AI-assisted (Claude) | Tested on local instance with ~265k file corpus

…ansaction management

- Introduced a mechanism to skip reading files if their modification time (mtime) hasn't changed, reducing unnecessary file reads.
- Wrapped all database inserts/updates in a single transaction to improve performance.
- Updated the `findActiveDocument` function to include the `modified_at` field in the returned document structure.
- Enhanced logging to indicate the number of files skipped due to unchanged mtime.

These changes optimize the indexing process and improve overall efficiency.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants