react-native-macos/ReactCommon/fabric
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
..
activityindicator Fix deprecated glob usage. 2018-06-23 18:33:48 -07:00
attributedstring Fabric: Getting rid of `std::to_string()` 2018-06-29 12:18:27 -07:00
components Fix deprecated glob usage. 2018-06-23 18:33:48 -07:00
core Remove instanceHandle, pass event target instead + add dispatchToEmptyTarget 2018-06-29 15:32:27 -07:00
debug Fabric: Subtle changes that make GCC compiler happy 2018-06-29 12:18:27 -07:00
graphics Fabric: Making `fabric/graphics` compilable on Android 2018-07-01 21:36:59 -07:00
imagemanager Fix deprecated glob usage. 2018-06-23 18:33:48 -07:00
sample Fabric: Introducing `ContextContainer` 2018-06-22 07:32:49 -07:00
scrollview Fabric: Embracing non-trivial default values of some Props 2018-06-26 11:48:13 -07:00
text Fabric: Subtle changes that make GCC compiler happy 2018-06-29 12:18:27 -07:00
textlayoutmanager Fabric: Making `fabric/textlayoutmanager` compilable on Android 2018-07-01 21:37:00 -07:00
uimanager Fabric: The diffing algorithm does not use source nodes anymore 2018-07-06 14:49:07 -07:00
view Fabric: Subtle changes that make GCC compiler happy 2018-06-29 12:18:27 -07:00