Skip to content

test(tree): add Tree event-handler benchmark suite#27372

Open
Josmithr wants to merge 20 commits into
microsoft:mainfrom
Josmithr:tree/event-perf-bench-suite-pr
Open

test(tree): add Tree event-handler benchmark suite#27372
Josmithr wants to merge 20 commits into
microsoft:mainfrom
Josmithr:tree/event-perf-bench-suite-pr

Conversation

@Josmithr
Copy link
Copy Markdown
Contributor

@Josmithr Josmithr commented May 20, 2026

Adds some basic runtime benchmarks for Tree.on registration and event emission.

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.
Copilot AI review requested due to automatic review settings May 20, 2026 23:21
@Josmithr Josmithr requested a review from a team as a code owner May 20, 2026 23:21
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

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:

  • Correctness — logic errors, race conditions, lifecycle issues
  • Security — vulnerabilities, secret exposure, injection
  • API Compatibility — breaking changes, release tags, type design
  • Performance — algorithmic regressions, memory leaks
  • Testing — coverage gaps, hollow tests

How this works

  • Adjust the reviewer set by ticking/unticking boxes above. Reviewer toggles alone don't trigger anything.

  • Tick Start review below to dispatch the review fleet.

  • After review finishes, tick Start review again to request another run — it auto-resets after each dispatch.

  • This comment updates as new commits land; your reviewer selections are preserved.

  • Start review

Comment thread packages/dds/tree/src/test/simple-tree/treeEvents.bench.ts Outdated
Comment thread packages/dds/tree/src/test/simple-tree/treeEvents.bench.ts Outdated
Josmithr added 2 commits May 20, 2026 16:25
Co-authored-by: Joshua Smithrud <54606601+Josmithr@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.on subscribe/unsubscribe behavior across node kinds and listener counts.
  • Adds emission-cost benchmarks for nodeChanged when mutating a hydrated object with varying listener counts.
  • Adds retained-memory benchmarks for unhydrated kernel construction and per-subscription allocations.

Comment thread packages/dds/tree/src/test/simple-tree/treeEvents.bench.ts Outdated
Comment thread packages/dds/tree/src/test/simple-tree/treeEvents.bench.ts Outdated
Comment thread packages/dds/tree/src/test/simple-tree/treeEvents.bench.ts Outdated
Comment thread packages/dds/tree/src/test/simple-tree/treeEvents.bench.ts Outdated
@Josmithr Josmithr marked this pull request as draft May 20, 2026 23:39
Comment thread packages/dds/tree/src/test/simple-tree/api/treeNodeApi.bench.ts Outdated
Comment thread packages/dds/tree/src/test/simple-tree/api/treeNodeApi.bench.ts Outdated
Comment thread packages/dds/tree/src/test/simple-tree/api/treeNodeApi.bench.ts Outdated
Comment thread packages/dds/tree/src/test/simple-tree/api/treeNodeApi.bench.ts Outdated
@Josmithr Josmithr marked this pull request as ready for review May 21, 2026 21:40
Comment thread packages/dds/tree/src/test/simple-tree/api/treeNodeApi.bench.ts Outdated
Comment thread packages/dds/tree/src/test/simple-tree/api/treeNodeApi.bench.ts Outdated
Comment thread packages/dds/tree/src/test/simple-tree/api/treeNodeApi.bench.ts Outdated
@Josmithr Josmithr enabled auto-merge (squash) May 21, 2026 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants