FluidFramework icon indicating copy to clipboard operation
FluidFramework copied to clipboard

perf(tree): avoid cloning change enricher checkout on every change

Open yann-achard-MS opened this issue 1 year ago • 1 comments

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

yann-achard-MS avatar May 11 '24 01:05 yann-achard-MS

@fluid-example/bundle-size-tests: +4.16 KB
Metric NameBaseline SizeCompare SizeSize Diff
aqueduct.js 453.27 KB 453.27 KB No change
azureClient.js 552.46 KB 552.46 KB No change
connectionState.js 680 Bytes 680 Bytes No change
containerRuntime.js 256.95 KB 256.95 KB No change
fluidFramework.js 357.8 KB 359.88 KB +2.08 KB
loader.js 134.34 KB 134.34 KB No change
map.js 41.53 KB 41.53 KB No change
matrix.js 143.75 KB 143.75 KB No change
odspClient.js 520.83 KB 520.83 KB No change
odspDriver.js 97.3 KB 97.3 KB No change
odspPrefetchSnapshot.js 42.16 KB 42.16 KB No change
sharedString.js 160.27 KB 160.27 KB No change
sharedTree.js 357.78 KB 359.86 KB +2.08 KB
Total Size 3.19 MB 3.2 MB +4.16 KB

Baseline commit: acd340733e4f8c8ac41a9e8b383eb2e134cd7bf5

Generated by :no_entry_sign: dangerJS against d6d916826b80424bafd882d63bb7be9e0f1a11eb

msfluid-bot avatar May 13 '24 16:05 msfluid-bot