Repository navigation
Conversation
Reviewer's GuideThis PR improves bulk editing performance by batching geometry reads, minimizing selector and grip DOM updates, reusing selector instances efficiently, and optimizing matrix, history, and UI lookup paths while retaining 3D transform behavior and adding browser regressions for the highest-risk changes. Sequence diagram for batched bulk selection geometry updatessequenceDiagram
participant Selection
participant SelectorManager
participant Selector
participant DOM
Selection->>Selection: getBBox(elem)
Selection->>SelectorManager: requestSelector(elem, bbox)
SelectorManager->>Selector: reset(elem, bbox)
Selection->>Selector: showGrips(false)
Selection->>Selector: resize(bbox)
Selector->>DOM: update selector outline
opt grips shown
Selector->>Selector: updateGrips()
Selector->>DOM: update shared grip positions
end
Sequence diagram for bulk movement and selector reusesequenceDiagram
participant Move
participant SelectorManager
participant Selector
participant DOM
Move->>Move: apply movement transforms
Move->>Move: utilsGetBBox(selected)
Move->>SelectorManager: requestSelector(selected, bbox)
SelectorManager->>Selector: reuse available selector
SelectorManager->>Selector: resize(bbox)
Selector->>DOM: update selector outline
opt active grips
Selector->>Selector: updateGrips()
Selector->>DOM: update shared grips
end
Flow diagram for optimized matrix multiplicationflowchart LR
A[Matrix arguments] --> B{Any matrix is2D false?}
B -->|Yes| C[DOMMatrix.fromMatrix]
C --> D[3D matrix multiplication]
B -->|No| E[Accumulate a b c d e f numerically]
E --> F[Create SVG matrix result]
D --> G[normalizeNearZero]
F --> G
H[Empty transform list] --> I[Return identity transform]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This branch has not been deployed
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.
PR description
Bulk selection and movement repeatedly alternate geometry reads with selection-outline writes. They also update the shared resize grips for elements whose grips are hidden. This makes commands on selections of hundreds of shapes expensive.
This change:
Performance evidence
Exploratory Chromium benchmarks against
c44f061d2f9a626d2771cc931298af5a45522d87(the current master), using 500 rect/circle elements and 100 measurements per scenario. Five workers each run one scenario at a time. Values are medians in milliseconds:The timer covers the synchronous API call and its synchronous handlers, including layout forced during that call. Setup and result checks are outside the timer. Deferred work and subsequent paint are excluded; in particular, the fill result does not measure completion of the deferred fill operation. These are measurements on one machine with concurrent workers, and the patch was selected during a 20-iteration optimization experiment, rather than evaluated on an independent holdout run.
The source changes are the accepted cumulative patch from
iteration-018. Raw samples and iteration history and the benchmark harness are available for inspection.Validation
npm run buildpassed.npm testpassed: Standard lint, 617 unit tests, and 87 Playwright tests.The repository's PR template refers to Cypress; these tests use its current Playwright suite. No user-facing API changes or new documentation are needed.
Summary by Sourcery
Optimize bulk selection and editing workflows while preserving selection geometry and transform behavior.
Bug Fixes:
Enhancements:
Tests: