Repository navigation
Refactor source cache into CachedFile struct - #12240
Merged
Merged
Conversation
Get rid of two parallel `Vec`s in `StateDelta` and `EngineState`, that also duplicated span information. Use a struct with documenting fields. Also use `Arc<str>` and `Arc<[u8]>` for the allocations as they are never modified and cloned often (see nushell#12229 for the first improvement). This also makes the representation more compact as no capacity is necessary.
No protection, just documentation.
kubouch
reviewed
Mar 19, 2024
| // Use Arcs of slice types for more compact representation (capacity less) | ||
| pub content: Arc<[u8]>, | ||
| // TODO: when refactoring `Span` to IDs this needs to remain an interval | ||
| pub covered_span: Span, |
Contributor
There was a problem hiding this comment.
You mean to keep it as Span, not converting to SpanId?
Member
Author
There was a problem hiding this comment.
As long as we translate to Span with a global index we would need that to translate back to indices into content
Member
Author
There was a problem hiding this comment.
After looking how #12239 works right now I removed this particular comment, and documented the struct publicly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Get rid of two parallel
Vecs inStateDeltaandEngineState, that also duplicated span information. Use a struct with documenting fields.Also use
Arc<str>andArc<[u8]>for the allocations as they are never modified and cloned often (see #12229 for the first improvement). This also makes the representation more compact as no capacity is necessary.User-Facing Changes
API breakage on
EngineState/StateWorkingSet/StateDeltathat should not really affect plugin authors.