test(tree): add Tree event-handler benchmark suite#27372
Open
Josmithr wants to merge 20 commits into
Open
Conversation
Adds packages/dds/tree/src/test/simple-tree/treeEvents.bench.ts covering: - Tree.on subscribe + unsubscribe round-trip (hydrated and unhydrated; object, array, map; nodeChanged and treeChanged). - First-listener vs N-th-listener cost on a hydrated object. - Bulk subscribe + bulk unsubscribe at N = 1 / 10 / 100. - Kernel construction cost for object, array, and map root nodes (including large arrays). - Emission cost: mutating a node while N listeners are attached. - Retained-memory benches for unhydrated kernel construction and per-subscription retained allocations. Runs under FLUID_TEST_PERF_MODE=1 with the @fluid-tools/benchmark reporter. Used to evaluate a series of event-handling perf changes.
Contributor
|
Hi! Thank you for opening this PR. Want me to review it? Based on the diff (169 lines, 1 files), I've queued these reviewers:
How this works
|
Josmithr
commented
May 20, 2026
Josmithr
commented
May 20, 2026
Co-authored-by: Joshua Smithrud <54606601+Josmithr@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new SharedTree/SimpleTree benchmark suite focused on the Tree.on event-handling stack, intended to provide a stable baseline for future perf work.
Changes:
- Introduces CPU benchmarks for
Tree.onsubscribe/unsubscribe behavior across node kinds and listener counts. - Adds emission-cost benchmarks for
nodeChangedwhen mutating a hydrated object with varying listener counts. - Adds retained-memory benchmarks for unhydrated kernel construction and per-subscription allocations.
Josmithr
commented
May 21, 2026
Josmithr
commented
May 21, 2026
Josmithr
commented
May 21, 2026
Josmithr
commented
May 21, 2026
Co-authored-by: Joshua Smithrud <54606601+Josmithr@users.noreply.github.com>
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.
Adds some basic runtime benchmarks for
Tree.onregistration and event emission.