measure delay of calling into UI thread when setting up ReactContext
Reviewed By: yungsters Differential Revision: D4736627 fbshipit-source-id: 6d425ef0ad7bbd54296a619009136c929cb16030
This commit is contained in:
parent
848593c0f0
commit
e2204c5ccb
|
@ -78,6 +78,8 @@ import static com.facebook.react.bridge.ReactMarkerConstants.CREATE_CATALYST_INS
|
|||
import static com.facebook.react.bridge.ReactMarkerConstants.CREATE_REACT_CONTEXT_START;
|
||||
import static com.facebook.react.bridge.ReactMarkerConstants.CREATE_VIEW_MANAGERS_END;
|
||||
import static com.facebook.react.bridge.ReactMarkerConstants.CREATE_VIEW_MANAGERS_START;
|
||||
import static com.facebook.react.bridge.ReactMarkerConstants.PRE_SETUP_REACT_CONTEXT_END;
|
||||
import static com.facebook.react.bridge.ReactMarkerConstants.PRE_SETUP_REACT_CONTEXT_START;
|
||||
import static com.facebook.react.bridge.ReactMarkerConstants.PROCESS_PACKAGES_END;
|
||||
import static com.facebook.react.bridge.ReactMarkerConstants.PROCESS_PACKAGES_START;
|
||||
import static com.facebook.react.bridge.ReactMarkerConstants.SETUP_REACT_CONTEXT_END;
|
||||
|
@ -217,7 +219,10 @@ public class ReactInstanceManager {
|
|||
Assertions.assertCondition(params != null && params.length > 0 && params[0] != null);
|
||||
try {
|
||||
JavaScriptExecutor jsExecutor = params[0].getJsExecutorFactory().create();
|
||||
return Result.of(createReactContext(jsExecutor, params[0].getJsBundleLoader()));
|
||||
ReactApplicationContext reactApplicationContext =
|
||||
createReactContext(jsExecutor, params[0].getJsBundleLoader());
|
||||
ReactMarker.logMarker(PRE_SETUP_REACT_CONTEXT_START);
|
||||
return Result.of(reactApplicationContext);
|
||||
} catch (Exception e) {
|
||||
// Pass exception to onPostExecute() so it can be handled on the main thread
|
||||
return Result.of(e);
|
||||
|
@ -777,6 +782,7 @@ public class ReactInstanceManager {
|
|||
}
|
||||
|
||||
private void setupReactContext(ReactApplicationContext reactContext) {
|
||||
ReactMarker.logMarker(PRE_SETUP_REACT_CONTEXT_END);
|
||||
ReactMarker.logMarker(SETUP_REACT_CONTEXT_START);
|
||||
Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "setupReactContext");
|
||||
UiThreadUtil.assertOnUiThread();
|
||||
|
|
|
@ -68,5 +68,6 @@ public class ReactMarkerConstants {
|
|||
public static final String ON_HOST_PAUSE_END = "ON_HOST_PAUSE_END";
|
||||
public static final String CONVERT_CONSTANTS_START = "CONVERT_CONSTANTS_START";
|
||||
public static final String CONVERT_CONSTANTS_END = "CONVERT_CONSTANTS_END";
|
||||
public static final String PRE_REACT_CONTEXT_END = "PRE_REACT_CONTEXT_END";
|
||||
public static final String PRE_SETUP_REACT_CONTEXT_START = "PRE_SETUP_REACT_CONTEXT_START";
|
||||
public static final String PRE_SETUP_REACT_CONTEXT_END = "PRE_SETUP_REACT_CONTEXT_END";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue