From 6224ef5301d67266b28c77e5e46816f319122f38 Mon Sep 17 00:00:00 2001 From: Alexey Lang Date: Mon, 29 Jan 2018 10:59:31 -0800 Subject: [PATCH] Measure time to create ReactInstanceManager Reviewed By: fkgozali Differential Revision: D6591797 fbshipit-source-id: 7345b7c772eb4ae35ad570082090fbdf704102d3 --- .../main/java/com/facebook/react/ReactNativeHost.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java b/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java index e0bb488e4..1c12e913e 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java +++ b/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java @@ -17,6 +17,8 @@ import android.app.Application; import com.facebook.infer.annotation.Assertions; import com.facebook.react.bridge.JavaScriptExecutorFactory; +import com.facebook.react.bridge.ReactMarker; +import com.facebook.react.bridge.ReactMarkerConstants; import com.facebook.react.common.LifecycleState; import com.facebook.react.devsupport.RedBoxHandler; import com.facebook.react.uimanager.UIImplementationProvider; @@ -39,7 +41,9 @@ public abstract class ReactNativeHost { */ public ReactInstanceManager getReactInstanceManager() { if (mReactInstanceManager == null) { + ReactMarker.logMarker(ReactMarkerConstants.GET_REACT_INSTANCE_MANAGER_START); mReactInstanceManager = createReactInstanceManager(); + ReactMarker.logMarker(ReactMarkerConstants.GET_REACT_INSTANCE_MANAGER_END); } return mReactInstanceManager; } @@ -64,6 +68,7 @@ public abstract class ReactNativeHost { } protected ReactInstanceManager createReactInstanceManager() { + ReactMarker.logMarker(ReactMarkerConstants.BUILD_REACT_INSTANCE_MANAGER_START); ReactInstanceManagerBuilder builder = ReactInstanceManager.builder() .setApplication(mApplication) .setJSMainModulePath(getJSMainModuleName()) @@ -83,7 +88,9 @@ public abstract class ReactNativeHost { } else { builder.setBundleAssetName(Assertions.assertNotNull(getBundleAssetName())); } - return builder.build(); + ReactInstanceManager reactInstanceManager = builder.build(); + ReactMarker.logMarker(ReactMarkerConstants.BUILD_REACT_INSTANCE_MANAGER_END); + return reactInstanceManager; } /**