Skip to content

perf: optimize array mutations and repeat reconciliation - #7784

Open
John Kreitlow (radium-v) wants to merge 1 commit into
mainfrom
users/radium-v/make-repeat-faster
Open

John Kreitlow (radium-v) wants to merge 1 commit into
mainfrom
users/radium-v/make-repeat-faster

Conversation

@radium-v

Copy link
Copy Markdown
Collaborator

Pull Request

📖 Description

Reduce array-observation and repeat-rendering overhead for large or frequently mutated lists. Optimize sort bookkeeping, large-array splice normalization, and view reconciliation while preserving item-view associations and keeping stable views mounted.

Fix mixed reorder/splice batches so subscribers reconcile against the final array, and refresh repeat positioning metadata after reorders.

Add regression tests and observer-only, CSR/SSR mutation, and hydration benchmarks. Update design documentation, API documentation, and export-size reports.

📑 Test Plan

  • 346 focused array-observer and repeat tests passed.
  • 14,084 differential comparisons matched the previous edit-distance and splice output.
  • Repeat-mutation benchmarks completed successfully with BENCH_ITERATIONS=20 npm run bench -w @microsoft/fast-bench -- repeat-mutations.

✅ Checklist

General

  • I have included a change request file using $ npm run change
  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the standards for this project.

Agents

  • I have linked to an existing issue in this project that this change addresses
  • I have read the skills
  • I have read the DESIGN.md file(s) in packages relevant to my changes
  • I have updated the DESIGN.md file(s) in packages relevant to my changes

- Reduce sort bookkeeping and large-array splice normalization costs
- Compose reorders and minimize DOM moves while retaining stable views
- Fix mixed mutation batches and repeat positioning updates
- Add regression tests and CSR/SSR mutation benchmarks
@radium-v

Copy link
Copy Markdown
Collaborator Author

There are additional existing repeat bugs that have been discovered out of this investigation. I'm testing fixes for them now. This PR may get split up.

This branch has not been deployed

No deployments
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.

1 participant