Repository navigation
Commit 21241d4
committed
Emit Fabric subtree mount and unmount mutations directly
When a whole subtree is inserted or removed, the Differentiator builds temporary mutation lists at each level and moves their contents into the parent's list. Write mutations directly into the output list in platform order. Reuse storage for pairs of shadow nodes and views across the traversal and use visible child counts to reserve mutation capacity.
The C++ mounting suite passes. The new regression test replays the mutations for a subtree with concrete and flattened children and compares the resulting mounted tree with an independently built stub tree.
A Debug C++ benchmark on Apple M6 diffs a tree of 341 concrete views in which each parent has four children. The median across five batches falls from 12.89M to 4.15M retired instructions per mount diff and from 12.90M to 4.14M per unmount diff. Both versions emit 682 mutations per diff.1 parent 075deb0 commit 21241d4
3 files changed
Lines changed: 577 additions & 185 deletions
File tree
- packages/react-native/ReactCommon/react/renderer/mounting
- internal
- tests
0 commit comments