Skip to content

test(tree): Add simple plain text insert/remove character op-size benchmark tests#26840

Open
Josmithr wants to merge 6 commits intomicrosoft:mainfrom
Josmithr:tree/text-benchmarks
Open

test(tree): Add simple plain text insert/remove character op-size benchmark tests#26840
Josmithr wants to merge 6 commits intomicrosoft:mainfrom
Josmithr:tree/text-benchmarks

Conversation

@Josmithr
Copy link
Contributor

@Josmithr Josmithr commented Mar 25, 2026

Insert character

Scenario Total Op Size (Bytes) Total Ops
Insert 1 character into empty string 584 1
Insert 1 character into long string (1000 characters) 598 1

Remove character

Scenario Total Op Size (Bytes) Total Ops
Remove 1 character from short string (1 character) 413 1
Remove 1 character from long string (1000 characters) 427 1

@Josmithr Josmithr requested a review from CraigMacomber March 25, 2026 21:24
@Josmithr Josmithr requested a review from a team as a code owner March 25, 2026 21:24
Copilot AI review requested due to automatic review settings March 25, 2026 21:24
* Licensed under the MIT License.
*/

import type { ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note for reviewers: this code was extracted from opSize.bench.ts for reuse.

Copy link
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 op-size benchmark coverage for the TextDomain plain-text editing path, and factors common op-capture/stat logic into a shared utility to reuse across benchmark suites.

Changes:

  • Add new TextDomain benchmarks for inserting/removing a single character in short and long strings, reporting total/max op sizes and op count.
  • Extract createConnectedTree, registerOpListener, and op-size stats helpers into a new opBenchmarkUtilities.ts.
  • Refactor opSize.bench.ts to use the shared utilities and remove duplicated helper code/imports.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/dds/tree/src/test/shared-tree/textDomain.bench.ts New measurement benchmarks for single-character insert/remove in TextAsTree, reporting op-size stats.
packages/dds/tree/src/test/shared-tree/opSize.bench.ts Removes locally-defined op-capture/stats helpers in favor of the shared benchmark utilities.
packages/dds/tree/src/test/shared-tree/opBenchmarkUtilities.ts Introduces shared helpers for creating a connected test tree, capturing submitted ops, and computing op-size stats.

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.

2 participants