Add more systrace to RN startup
Summary: Added systrace to the following sections 1. When Marketplace Home Fragment is created 2. On initialization of Catalyst Instance Reviewed By: achen1 Differential Revision: D9665376 fbshipit-source-id: e48e9f50dad42c71fb2151538f65bc54939adc1e
This commit is contained in:
parent
d838b6c550
commit
b1d205a28f
|
@ -1128,9 +1128,13 @@ public class ReactInstanceManager {
|
||||||
catalystInstance.setGlobalVariable("__RCTProfileIsProfiling", "true");
|
catalystInstance.setGlobalVariable("__RCTProfileIsProfiling", "true");
|
||||||
}
|
}
|
||||||
ReactMarker.logMarker(ReactMarkerConstants.PRE_RUN_JS_BUNDLE_START);
|
ReactMarker.logMarker(ReactMarkerConstants.PRE_RUN_JS_BUNDLE_START);
|
||||||
|
Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "runJSBundle");
|
||||||
catalystInstance.runJSBundle();
|
catalystInstance.runJSBundle();
|
||||||
|
Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);
|
||||||
|
|
||||||
reactContext.initializeWithInstance(catalystInstance);
|
reactContext.initializeWithInstance(catalystInstance);
|
||||||
|
|
||||||
|
|
||||||
return reactContext;
|
return reactContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1190,6 +1194,6 @@ public class ReactInstanceManager {
|
||||||
if (reactPackage instanceof ReactPackageLogger) {
|
if (reactPackage instanceof ReactPackageLogger) {
|
||||||
((ReactPackageLogger) reactPackage).endProcessPackage();
|
((ReactPackageLogger) reactPackage).endProcessPackage();
|
||||||
}
|
}
|
||||||
SystraceMessage.endSection(TRACE_TAG_REACT_JAVA_BRIDGE).flush();
|
SystraceMessage.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
|
|
||||||
package com.facebook.react.bridge;
|
package com.facebook.react.bridge;
|
||||||
|
|
||||||
|
import static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JAVA_BRIDGE;
|
||||||
|
|
||||||
import android.content.res.AssetManager;
|
import android.content.res.AssetManager;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
@ -103,6 +105,8 @@ public class CatalystInstanceImpl implements CatalystInstance {
|
||||||
final JSBundleLoader jsBundleLoader,
|
final JSBundleLoader jsBundleLoader,
|
||||||
NativeModuleCallExceptionHandler nativeModuleCallExceptionHandler) {
|
NativeModuleCallExceptionHandler nativeModuleCallExceptionHandler) {
|
||||||
Log.d(ReactConstants.TAG, "Initializing React Xplat Bridge.");
|
Log.d(ReactConstants.TAG, "Initializing React Xplat Bridge.");
|
||||||
|
Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "createCatalystInstanceImpl");
|
||||||
|
|
||||||
mHybridData = initHybrid();
|
mHybridData = initHybrid();
|
||||||
|
|
||||||
mReactQueueConfiguration = ReactQueueConfigurationImpl.create(
|
mReactQueueConfiguration = ReactQueueConfigurationImpl.create(
|
||||||
|
@ -115,8 +119,10 @@ public class CatalystInstanceImpl implements CatalystInstance {
|
||||||
mNativeModuleCallExceptionHandler = nativeModuleCallExceptionHandler;
|
mNativeModuleCallExceptionHandler = nativeModuleCallExceptionHandler;
|
||||||
mNativeModulesQueueThread = mReactQueueConfiguration.getNativeModulesQueueThread();
|
mNativeModulesQueueThread = mReactQueueConfiguration.getNativeModulesQueueThread();
|
||||||
mTraceListener = new JSProfilerTraceListener(this);
|
mTraceListener = new JSProfilerTraceListener(this);
|
||||||
|
Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);
|
||||||
|
|
||||||
Log.d(ReactConstants.TAG, "Initializing React Xplat Bridge before initializeBridge");
|
Log.d(ReactConstants.TAG, "Initializing React Xplat Bridge before initializeBridge");
|
||||||
|
Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "initializeCxxBridge");
|
||||||
initializeBridge(
|
initializeBridge(
|
||||||
new BridgeCallback(this),
|
new BridgeCallback(this),
|
||||||
jsExecutor,
|
jsExecutor,
|
||||||
|
@ -125,6 +131,7 @@ public class CatalystInstanceImpl implements CatalystInstance {
|
||||||
mNativeModuleRegistry.getJavaModules(this),
|
mNativeModuleRegistry.getJavaModules(this),
|
||||||
mNativeModuleRegistry.getCxxModules());
|
mNativeModuleRegistry.getCxxModules());
|
||||||
Log.d(ReactConstants.TAG, "Initializing React Xplat Bridge after initializeBridge");
|
Log.d(ReactConstants.TAG, "Initializing React Xplat Bridge after initializeBridge");
|
||||||
|
Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);
|
||||||
|
|
||||||
mJavaScriptContextHolder = new JavaScriptContextHolder(getJavaScriptContext());
|
mJavaScriptContextHolder = new JavaScriptContextHolder(getJavaScriptContext());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue