-
Notifications
You must be signed in to change notification settings - Fork 67
Improve support for sparse cache. #1562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve support for sparse cache. #1562
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new :pin filter feature for Josh along with a sequence number caching optimization. The pin filter allows selective tree contents to be "held off" at parent revision versions, useful for temporarily excluding sensitive changes. The sequence number optimization improves cache efficiency by reducing the number of git notes created.
Key changes:
- Implementation of the
:pinfilter that prevents appearance of selected subtrees for specific revisions - Addition of sequence number tracking for commits to optimize caching
- Refactored history walking logic to use hide callbacks instead of pre-computing known commits
Reviewed Changes
Copilot reviewed 53 out of 53 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| josh-core/src/filter/mod.rs | Added Op::Pin variant, pin filter application logic, and sequence_number handling |
| josh-core/src/filter/parse.rs | Added parsing support for :pin filter syntax |
| josh-core/src/filter/opt.rs | Extended filter optimization functions to handle Pin operations |
| josh-core/src/cache.rs | Added sequence number computation and encoding/decoding functions; updated cache interface |
| josh-core/src/cache_notes.rs | Modified to use sequence numbers for selective note storage and path partitioning |
| josh-core/src/cache_sled.rs | Updated cache backend interface to accept sequence_number parameter |
| josh-core/src/cache_stack.rs | Updated to propagate sequence_number through cache operations |
| josh-core/src/history.rs | Refactored walk logic to use hide callbacks; removed find_known function |
| docs/src/reference/filters.md | Added documentation for the :pin filter |
| tests/filter/*.t | Updated test expectations to include sequence_number output lines |
| tests/filter/pin_*.t | Added new test files demonstrating pin filter usage |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ddc80aa to
b81101d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 47 out of 47 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d57c3f2 to
a51b156
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 47 out of 47 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a51b156 to
170fb37
Compare
With the addition of a notes backed cache we will have the possibility of avoiding a "cold start" by transferring just the notes to another repo. To keep the amount of extra data small the notes cache is kept sparse: Not all commits have and entry and also in shards by sequence number, as old entries are unlikely to be relevant. The old traversal logic did not perform very well with sparse cache. Especially "find_known" proved to be a bottleneck. So the traversal is revised now to work better in the sparse cache case. Change: cache-sparse-shards
170fb37 to
f861282
Compare
With the addition of a notes backed cache we will have the possibility of avoiding a "cold start" by transferring just the notes to another repo. To keep the amount of extra data small the notes cache is kept sparse: Not all commits have and entry and also in shards by sequence number, as old entries are unlikely to be relevant.
The old traversal logic did not perform very well with sparse cache. Especially "find_known" proved to be a bottleneck. So the traversal is revised now to work better in the sparse cache case.
Change: cache-sparse-shards