Permalink
Browse files

Measure time to create ReactInstanceManager

Reviewed By: fkgozali

Differential Revision: D6591797

fbshipit-source-id: 7345b7c772eb4ae35ad570082090fbdf704102d3
  • Loading branch information...
alexeylang authored and facebook-github-bot committed Jan 29, 2018
1 parent e3ff3cf commit 6224ef5301d67266b28c77e5e46816f319122f38
Showing with 8 additions and 1 deletion.
  1. +8 −1 ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java
@@ -17,6 +17,8 @@
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 @@ protected ReactNativeHost(Application application) {
*/
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 void clear() {
}
protected ReactInstanceManager createReactInstanceManager() {
ReactMarker.logMarker(ReactMarkerConstants.BUILD_REACT_INSTANCE_MANAGER_START);
ReactInstanceManagerBuilder builder = ReactInstanceManager.builder()
.setApplication(mApplication)
.setJSMainModulePath(getJSMainModuleName())
@@ -83,7 +88,9 @@ protected ReactInstanceManager createReactInstanceManager() {
} else {
builder.setBundleAssetName(Assertions.assertNotNull(getBundleAssetName()));
}
return builder.build();
ReactInstanceManager reactInstanceManager = builder.build();
ReactMarker.logMarker(ReactMarkerConstants.BUILD_REACT_INSTANCE_MANAGER_END);
return reactInstanceManager;
}
/**

0 comments on commit 6224ef5

Please sign in to comment.