react-native-macos/ReactCommon
Valentin Shergin e8ec1cb16a Fabric: The diffing algorithm does not use source nodes anymore
Summary:
@public
... and it's as efficient as it was before.

The previous version of the algorithm used `sourceNode` reference to know the previous state of the node to call the algorithm recursively.
That wasn't so good because of several reasons:
 - It was fragile because we had two different sources of the truth of the "previous state of the tree": committed tree and source node pointer;
 - We had to store weak pointers to source nodes inside cloned nodes. That is not free in terms of performance;
 - The old approach introduced a constraint that all previously used and now reinserted nodes must be cloned to update source node (otherwise, the algorithm would regenerate instructions recreating already existing subtrees);
 - That cloning required access to `isSealed` flag which is supposed to be a debug-only thing (that actually affects performance and must be compile-out for release builds).

The new approach compares nodes with same react tag and naturally cloning-artifacts resilient.

Yes, the new approach uses a map of inserted nodes, but the previous one already had it (otherwise there is no way to tell which nodes should be "deleted"). And anyway, this is a very little map that exists for a very little period of time.

Reviewed By: mdvacca

Differential Revision: D8709953

fbshipit-source-id: 027abb326cf45f00f7bb0bbd7c4e612578268c66
2018-07-06 14:49:07 -07:00
..
cxxreact Move conditional logic into corresponding build defs. 2018-06-24 14:46:38 -07:00
fabric Fabric: The diffing algorithm does not use source nodes anymore 2018-07-06 14:49:07 -07:00
jschelpers Move conditional logic into corresponding build defs. 2018-06-24 14:46:38 -07:00
jsinspector Fix deprecated glob usage. 2018-06-23 18:33:48 -07:00
microprofiler Migrate Android sources to MIT license header 2018-05-31 15:37:30 -07:00
privatedata Fix deprecated glob usage. 2018-06-23 18:33:48 -07:00
yoga Avoid cleaning up Owner of YGNode during clonning 2018-06-28 22:48:35 -07:00