From cb14b063092bb71efa906aa156f73b5cc0970e0e Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Fri, 11 Jan 2019 18:03:25 -0800 Subject: [PATCH] Fabric: More systraces for Diffing and Commit phase Summary: Trivial. Reviewed By: mdvacca Differential Revision: D13644482 fbshipit-source-id: 90cfa04797682e57fc4de009fe4a412167b9e8cd --- ReactCommon/fabric/mounting/Differentiator.cpp | 3 +++ ReactCommon/fabric/uimanager/ShadowTree.cpp | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/ReactCommon/fabric/mounting/Differentiator.cpp b/ReactCommon/fabric/mounting/Differentiator.cpp index 9bac22008..1243740fd 100644 --- a/ReactCommon/fabric/mounting/Differentiator.cpp +++ b/ReactCommon/fabric/mounting/Differentiator.cpp @@ -6,6 +6,7 @@ #include "Differentiator.h" #include +#include #include "ShadowView.h" namespace facebook { @@ -214,6 +215,8 @@ static void calculateShadowViewMutations( ShadowViewMutationList calculateShadowViewMutations( const ShadowNode &oldRootShadowNode, const ShadowNode &newRootShadowNode) { + SystraceSection s("calculateShadowViewMutations"); + // Root shadow nodes must have same tag. assert(oldRootShadowNode.getTag() == newRootShadowNode.getTag()); diff --git a/ReactCommon/fabric/uimanager/ShadowTree.cpp b/ReactCommon/fabric/uimanager/ShadowTree.cpp index b1cb6e87f..134e9a3d1 100644 --- a/ReactCommon/fabric/uimanager/ShadowTree.cpp +++ b/ReactCommon/fabric/uimanager/ShadowTree.cpp @@ -7,6 +7,7 @@ #include #include +#include #include #include @@ -130,6 +131,7 @@ bool ShadowTree::completeByReplacingShadowNode( bool ShadowTree::complete( const SharedRootShadowNode &oldRootShadowNode, const UnsharedRootShadowNode &newRootShadowNode) const { + SystraceSection s("ShadowTree::complete"); newRootShadowNode->layout(); newRootShadowNode->sealRecursive(); @@ -153,6 +155,7 @@ bool ShadowTree::commit( const SharedRootShadowNode &oldRootShadowNode, const SharedRootShadowNode &newRootShadowNode, const ShadowViewMutationList &mutations) const { + SystraceSection s("ShadowTree::commit"); std::lock_guard lock(commitMutex_); if (oldRootShadowNode != rootShadowNode_) { @@ -168,6 +171,8 @@ bool ShadowTree::commit( void ShadowTree::emitLayoutEvents( const ShadowViewMutationList &mutations) const { + SystraceSection s("ShadowTree::emitLayoutEvents"); + for (const auto &mutation : mutations) { // Only `Insert` and `Update` mutations can affect layout metrics. if (mutation.type != ShadowViewMutation::Insert &&