Skip to content

Commit 6224ef5

Browse files
alexeylangfacebook-github-bot
authored andcommitted
Measure time to create ReactInstanceManager
Reviewed By: fkgozali Differential Revision: D6591797 fbshipit-source-id: 7345b7c772eb4ae35ad570082090fbdf704102d3
1 parent e3ff3cf commit 6224ef5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
import com.facebook.infer.annotation.Assertions;
1919
import com.facebook.react.bridge.JavaScriptExecutorFactory;
20+
import com.facebook.react.bridge.ReactMarker;
21+
import com.facebook.react.bridge.ReactMarkerConstants;
2022
import com.facebook.react.common.LifecycleState;
2123
import com.facebook.react.devsupport.RedBoxHandler;
2224
import com.facebook.react.uimanager.UIImplementationProvider;
@@ -39,7 +41,9 @@ protected ReactNativeHost(Application application) {
3941
*/
4042
public ReactInstanceManager getReactInstanceManager() {
4143
if (mReactInstanceManager == null) {
44+
ReactMarker.logMarker(ReactMarkerConstants.GET_REACT_INSTANCE_MANAGER_START);
4245
mReactInstanceManager = createReactInstanceManager();
46+
ReactMarker.logMarker(ReactMarkerConstants.GET_REACT_INSTANCE_MANAGER_END);
4347
}
4448
return mReactInstanceManager;
4549
}
@@ -64,6 +68,7 @@ public void clear() {
6468
}
6569

6670
protected ReactInstanceManager createReactInstanceManager() {
71+
ReactMarker.logMarker(ReactMarkerConstants.BUILD_REACT_INSTANCE_MANAGER_START);
6772
ReactInstanceManagerBuilder builder = ReactInstanceManager.builder()
6873
.setApplication(mApplication)
6974
.setJSMainModulePath(getJSMainModuleName())
@@ -83,7 +88,9 @@ protected ReactInstanceManager createReactInstanceManager() {
8388
} else {
8489
builder.setBundleAssetName(Assertions.assertNotNull(getBundleAssetName()));
8590
}
86-
return builder.build();
91+
ReactInstanceManager reactInstanceManager = builder.build();
92+
ReactMarker.logMarker(ReactMarkerConstants.BUILD_REACT_INSTANCE_MANAGER_END);
93+
return reactInstanceManager;
8794
}
8895

8996
/**

0 commit comments

Comments
 (0)