-
Notifications
You must be signed in to change notification settings - Fork 517
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
perf(tree): avoid cloning change enricher checkout on every change #21056
Merged
yann-achard-MS
merged 22 commits into
microsoft:main
from
yann-achard-MS:encode-before-apply
May 23, 2024
Merged
perf(tree): avoid cloning change enricher checkout on every change #21056
yann-achard-MS
merged 22 commits into
microsoft:main
from
yann-achard-MS:encode-before-apply
May 23, 2024
Conversation
This file contains 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
github-actions
bot
added
area: dds
Issues related to distributed data structures
area: dds: tree
base: main
PRs targeted against main branch
labels
May 11, 2024
⯅ @fluid-example/bundle-size-tests: +4.16 KB
Baseline commit: acd3407 |
yann-achard-MS
commented
May 20, 2024
yann-achard-MS
commented
May 20, 2024
noencke
approved these changes
May 22, 2024
private readonly enricher: ChangeEnricherReadonlyCheckout<TChange>; | ||
/** | ||
* Maps each local commit to the corresponding enriched commit. | ||
* Entries are added then the commits are prepared (before being applied and submitted). |
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.
Suggested change
* Entries are added then the commits are prepared (before being applied and submitted). | |
* Entries are added when the commits are prepared (before being applied and submitted). |
* This is similar to a {@link TreeCheckout} in that it represents the state of the tree at a specific revision. | ||
* But unlike a `TreeCheckout`... | ||
* - It is not backed by a branch because the `CommitEnricher` that owns it controls which revision it should represent. | ||
* - The host application has no knowledge of it, so applying changes to it has not impact on the application. |
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.
Suggested change
* - The host application has no knowledge of it, so applying changes to it has not impact on the application. | |
* - The host application has no knowledge of it, so applying changes to it has no impact on the application. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area: dds: tree
area: dds
Issues related to distributed data structures
base: main
PRs targeted against main branch
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
Before this PR, commits were enriched between their application to the local checkout and their sending to the service.
This required keeping a defensive clone of the enricher checkout so that it could enrich a commit based on the state immediately before that commit was applied.
This PR change the old order of operations (apply-enrich-submit) to enrich-apply-submit. This allows the enrichment to be performed based on the forest and detached field index of the top-level checkout instead of a clone, thus making cloning necessary only in resubmit scenarios.
While the above sounds simple, it prompted a lot of changes to accommodate the intricacies of transactions.
A subsequent PR (perhaps after GA if it is deemed to destabilizing) could clean up a lot of this complexity by making transactions less special throughout the system.
Breaking Changes
None