Skip to content
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

refactor(tree): Optimize certain leaf access cases #21595

Merged
merged 14 commits into from
Jun 26, 2024

Conversation

alexvy86
Copy link
Contributor

@alexvy86 alexvy86 commented Jun 22, 2024

Description

Refined PR based on the discussion in #21523 and offline chats, that works towards optimizing access to leaf values in SharedTree.

A couple of comments suggesting that the unboxing behavior of FieldNodes were causing confusion and making this seem more complicated than it ended up being, but it turns out that @CraigMacomber had already removed unboxing from FieldNodes in #18260, so this PR removes those comments and moves ahead with an initial optimization (for some cases) when accessing leaf values.

Reviewer Guidance

The review process is outlined on this wiki page.

The following div shows benchmark results from main and from this PR. Some unhydrated node cases seem to have a bit of a regression, but overall the changes seem good, particularly accessing values that are "simple leaves" (not unions) both in the unhydrated node and flex node cases. For access to leaves (simple and in unions) on object properties, all cases improved.

image

AB#6908

@alexvy86 alexvy86 requested a review from a team as a code owner June 22, 2024 01:38
@github-actions github-actions bot added area: dds Issues related to distributed data structures area: dds: tree labels Jun 22, 2024
@alexvy86 alexvy86 requested review from CraigMacomber and a team June 22, 2024 01:38
@github-actions github-actions bot added the base: main PRs targeted against main branch label Jun 22, 2024
@alexvy86
Copy link
Contributor Author

Updated description with latest benchmarks comparing main against the current state of the PR.

@msfluid-bot
Copy link
Collaborator

msfluid-bot commented Jun 25, 2024

@fluid-example/bundle-size-tests: +139 Bytes
Metric NameBaseline SizeCompare SizeSize Diff
aqueduct.js 451.97 KB 452 KB +35 Bytes
azureClient.js 550.55 KB 550.59 KB +49 Bytes
connectionState.js 680 Bytes 680 Bytes No change
containerRuntime.js 255.81 KB 255.82 KB +14 Bytes
fluidFramework.js 384.76 KB 384.72 KB -39 Bytes
loader.js 133.46 KB 133.47 KB +14 Bytes
map.js 41.1 KB 41.11 KB +7 Bytes
matrix.js 143.38 KB 143.38 KB +7 Bytes
odspClient.js 518.62 KB 518.66 KB +49 Bytes
odspDriver.js 97.21 KB 97.23 KB +21 Bytes
odspPrefetchSnapshot.js 42.21 KB 42.22 KB +14 Bytes
sharedString.js 159.88 KB 159.89 KB +7 Bytes
sharedTree.js 375.22 KB 375.18 KB -46 Bytes
Total Size 3.23 MB 3.23 MB +139 Bytes

Baseline commit: 4fb764f

Generated by 🚫 dangerJS against ead2d3a

@alexvy86 alexvy86 enabled auto-merge (squash) June 26, 2024 19:27
@alexvy86
Copy link
Contributor Author

/azp run Build - client packages

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@alexvy86 alexvy86 merged commit 41ee750 into microsoft:main Jun 26, 2024
30 checks passed
@alexvy86 alexvy86 deleted the optimize-leaf-access-2 branch June 26, 2024 22:01
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants