react-native/ReactCommon/fabric/core
Valentin Shergin 938e1d51c4 Fabric: ShadowNode::children_ is now managed in copy-on-write manner
Summary:
@public
ShadowNode class is designed to share `props` and `children` objects between instances. Given that all *Props classes are immutable, it's very easy to share them and we do this from the day one. The `children_` collection is more tricky though because ShadowNode class has a couple of mutation methods. Previously, we dealt with it very simply by copying the whole vector in constructors, and that was far from optimal. Now we store a special flag that indicates that the children list is shared among nodes, and we clone this before the first mutation.
Sharing a `shared_ptr` should be much more efficient (cost of atomic refcount increment) than instantiating whole new collection (an allocation).

Reviewed By: mdvacca

Differential Revision: D8988386

fbshipit-source-id: cb2f6b2fccac70a35e070a1aa108d135f77cd041
2018-08-04 09:47:30 -07:00
..
componentdescriptor Fabric: ShadowNode::Fragment 2018-08-04 09:47:30 -07:00
layout Fabric: Optimized ShadowNode::replaceChild() with `suggestedIndex` argument 2018-07-17 22:53:56 -07:00
primitives Fabric: Simplified way to specialize ComponentName in ConcreteShadowNode class template 2018-08-04 09:47:30 -07:00
shadownode Fabric: ShadowNode::children_ is now managed in copy-on-write manner 2018-08-04 09:47:30 -07:00
tests Fabric: `ShadowNode::getChildren()` now returns `vector`, not `shared_ptr` 2018-08-04 09:47:30 -07:00
BUCK Fabric: Events related classes were moved to separate buck target 2018-07-17 22:53:57 -07:00
conversions.h Fabric: New props treatment in `core` module 2018-05-14 16:03:49 -07:00
propsConversions.h Fabric: `fromDynamic` for float numbers was moved to `core` module 2018-06-26 11:48:12 -07:00