Performance optimization in fabric reconciler requires understanding of suspension behavior
The issue reports unnecessary completeRoot calls during suspended component state updates, suggesting a performance optimization. While the problem statement is clear, the solution requires understanding React Fiber and Fabric internals. The PR viability depends on confirming this is indeed a bug versus intended behavior.
React version: 19.3 (latest main)
Link to code example: https://github.com/facebook/react/pull/35262
I noticed that when we suspend a component in fabric react and in that component a state update occurs, that we still will call completeRoot.
This has performance implications, as completeRoot will call into c++ and invoke ShadowTree::commit in react-native.
I think that when a suspended component has a state update and we still show the very same fallback component, then there should be no completeRoot call, as technically, nothing has changed about the UI output.
I believe that this is a bug with in react-reconciler / react fabric
We shouldn't call completeRoot if there is no change in the rendering tree output.
Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!