diff --git a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java index 8d39fcaaa..338fa8713 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java @@ -1128,9 +1128,13 @@ public class ReactInstanceManager { catalystInstance.setGlobalVariable("__RCTProfileIsProfiling", "true"); } ReactMarker.logMarker(ReactMarkerConstants.PRE_RUN_JS_BUNDLE_START); + Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "runJSBundle"); catalystInstance.runJSBundle(); + Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE); + reactContext.initializeWithInstance(catalystInstance); + return reactContext; } @@ -1190,6 +1194,6 @@ public class ReactInstanceManager { if (reactPackage instanceof ReactPackageLogger) { ((ReactPackageLogger) reactPackage).endProcessPackage(); } - SystraceMessage.endSection(TRACE_TAG_REACT_JAVA_BRIDGE).flush(); + SystraceMessage.endSection(TRACE_TAG_REACT_JAVA_BRIDGE); } } diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java index 17f64d767..708c91bb7 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java @@ -7,6 +7,8 @@ package com.facebook.react.bridge; +import static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JAVA_BRIDGE; + import android.content.res.AssetManager; import android.os.AsyncTask; import android.util.Log; @@ -103,6 +105,8 @@ public class CatalystInstanceImpl implements CatalystInstance { final JSBundleLoader jsBundleLoader, NativeModuleCallExceptionHandler nativeModuleCallExceptionHandler) { Log.d(ReactConstants.TAG, "Initializing React Xplat Bridge."); + Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "createCatalystInstanceImpl"); + mHybridData = initHybrid(); mReactQueueConfiguration = ReactQueueConfigurationImpl.create( @@ -115,8 +119,10 @@ public class CatalystInstanceImpl implements CatalystInstance { mNativeModuleCallExceptionHandler = nativeModuleCallExceptionHandler; mNativeModulesQueueThread = mReactQueueConfiguration.getNativeModulesQueueThread(); mTraceListener = new JSProfilerTraceListener(this); + Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE); Log.d(ReactConstants.TAG, "Initializing React Xplat Bridge before initializeBridge"); + Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "initializeCxxBridge"); initializeBridge( new BridgeCallback(this), jsExecutor, @@ -125,6 +131,7 @@ public class CatalystInstanceImpl implements CatalystInstance { mNativeModuleRegistry.getJavaModules(this), mNativeModuleRegistry.getCxxModules()); Log.d(ReactConstants.TAG, "Initializing React Xplat Bridge after initializeBridge"); + Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE); mJavaScriptContextHolder = new JavaScriptContextHolder(getJavaScriptContext()); }