From a8ce2dcf8941e1eff8ddede2a2d92a64b41046e7 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Fri, 25 Oct 2019 15:07:18 -0700 Subject: [PATCH] Refactor logging of Fabric React Markers when running on the UI Thread Summary: This diff refactors the execution of the logging of Fabric React markers to be executed after the MountItems are executed on the UI Thred Changelog: Improve logging of Fabric react markers Reviewed By: JoshuaGross Differential Revision: D18010920 fbshipit-source-id: e36306102d190119a89c16e660b855acab1528fe --- .../com/facebook/react/fabric/FabricUIManager.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java b/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java index fec5627bd89..e1e39dd2a40 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java @@ -474,10 +474,14 @@ public class FabricUIManager implements UIManager, LifecycleEventListener { mMountItems.add(mountItem); } - // Post markers outside of lock + if (UiThreadUtil.isOnUiThread()) { + dispatchMountItems(); + } + + // Post markers outside of lock and after sync mounting finishes its execution if (isBatchMountItem) { ReactMarker.logFabricMarker( - ReactMarkerConstants.FABRIC_COMMIT_START, null, commitNumber, mCommitStartTime); + ReactMarkerConstants.FABRIC_COMMIT_START, null, commitNumber, commitStartTime); ReactMarker.logFabricMarker( ReactMarkerConstants.FABRIC_FINISH_TRANSACTION_START, null, @@ -498,10 +502,6 @@ public class FabricUIManager implements UIManager, LifecycleEventListener { ReactMarkerConstants.FABRIC_LAYOUT_END, null, commitNumber, layoutEndTime); ReactMarker.logFabricMarker(ReactMarkerConstants.FABRIC_COMMIT_END, null, commitNumber); } - - if (UiThreadUtil.isOnUiThread()) { - dispatchMountItems(); - } } @UiThread