Repository navigation
Conversation
3b1e8d5 to
21241d4
Compare
21241d4 to
6668815
Compare
|
Can you add a feature flag for this so we can manage the rollout? |
6668815 to
885af56
Compare
|
Added |
chrfalch
left a comment
There was a problem hiding this comment.
The fast path matches the existing all-create and all-delete branches. Creates still come before the subtree and inserts after it. Removes still run in reverse mount order and deletes in forward order. It also skips the same pairs that the existing code skips: non-concrete pairs, and concrete pairs whose children are flattened, for which the slicer returns an empty list anyway. Resizing the scope back after each child keeps memory bounded, and std::deque keeps the caller's pair pointers valid. I found no correctness problem. The two comments below are about a hidden side effect on the caller's pairs and one branch the new test does not reach.
885af56 to
aacb3fc
Compare
|
Thanks for the review. I made the move out of the pairs visible in the signature and added the missing tree shape to the test; details are in the two threads. The branch is also rebased onto current |
The Fabric Differentiator writes mount and unmount mutations for whole subtrees directly into the destination list when `enableDirectSubtreeMutations` is enabled. The flag defaults to off. Direct emission avoids allocating and merging a temporary mutation list at each level of the subtree. `ctest --test-dir private/react-native-fantom/build/tester/react-common-tests --output-on-failure -j 10` passes with the flag default off and in a local build with the default on. The regression test runs in both modes. It mounts and unmounts a subtree in which one view forms a stacking context, one view is flattened away, and one view stays in the mounted tree while its children mount in its parent. It compares the results with independently built trees. `yarn fantom packages/react-native/src/private/renderer/mounting/__tests__` passes with the default and with both values of the flag selected by a local `@fantom_flags enableDirectSubtreeMutations:*` override. A single Release C++ binary on Apple M6 uses `proc_pid_rusage` to count retired instructions for diffs of a 341-view tree with four children per parent. For each operation, both flag settings emit the same ordered list of 682 mutations. Across five batches of 1,000 diffs per setting with alternating flag order, the median per mount diff falls from 1,527,412 to 458,622 and the median per unmount diff from 1,526,089 to 457,443. `node scripts/clang-format.js --check`, `yarn flow-check` and `yarn lint` pass, and `yarn featureflags --update` reproduces the generated bindings. Signed-off-by: James Ide <ide@expo.dev>
aacb3fc to
f71e48d
Compare
Summary:
The Fabric Differentiator writes mount and unmount mutations for whole subtrees directly into the destination list when
enableDirectSubtreeMutationsis enabled. The flag defaults to off. Direct emission avoids allocating and merging a temporary mutation list at each level of the subtree.Changelog:
[INTERNAL] [CHANGED] - Add a feature flag for direct emission of Fabric subtree mount and unmount mutations.
Test Plan:
ctest --test-dir private/react-native-fantom/build/tester/react-common-tests --output-on-failure -j 10passes with the flag default off and in a local build with the default on. The regression test runs in both modes. It mounts and unmounts a subtree in which one view forms a stacking context, one view is flattened away, and one view stays in the mounted tree while its children mount in its parent. It compares the results with independently built trees.yarn fantom packages/react-native/src/private/renderer/mounting/__tests__passes with the default and with both values of the flag selected by a local@fantom_flags enableDirectSubtreeMutations:*override.A single Release C++ binary on Apple M6 uses
proc_pid_rusageto count retired instructions for diffs of a 341-view tree with four children per parent. For each operation, both flag settings emit the same ordered list of 682 mutations. Across five batches of 1,000 diffs per setting with alternating flag order, the median per mount diff falls from 1,527,412 to 458,622 and the median per unmount diff from 1,526,089 to 457,443.node scripts/clang-format.js --check,yarn flow-checkandyarn lintpass, andyarn featureflags --updatereproduces the generated bindings.