Skip to content

Commit

Permalink
Make TTRC markers consistent between Bridge and Bridgeless
Browse files Browse the repository at this point in the history
Summary:
The purpose of this change is to make TTRC markers work similarly for bridge loading and bridgeless loading so we could compare performance between them.

There are mainly four cases involved:
 ```REACT_BRIDGE_LOADING_START,
 REACT_BRIDGE_LOADING_END,
 REACT_BRIDGELESS_LOADING_START,
 REACT_BRIDGELESS_LOADING_END
```
First 2 are for beginning/ending of bridge loading which includes creating fragment, loading JS bundle, running JS bundle and creating react instance. Last 2 are for similar purpose with bridgeless.

Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D26514499

fbshipit-source-id: 65d6f3cc7de9e07a7a3a802dd77138e74c23aa5b
  • Loading branch information
luluwu2032 authored and facebook-github-bot committed Feb 22, 2021
1 parent c6d7af6 commit abf079a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,9 @@ private void recreateReactContextInBackground(
private void runCreateReactContextOnNewThread(final ReactContextInitParams initParams) {
FLog.d(ReactConstants.TAG, "ReactInstanceManager.runCreateReactContextOnNewThread()");
UiThreadUtil.assertOnUiThread();

// Mark start of bridge loading
ReactMarker.logMarker(ReactMarkerConstants.REACT_BRIDGE_LOADING_START);
synchronized (mAttachedReactRoots) {
synchronized (mReactContextLock) {
if (mCurrentReactContext != null) {
Expand Down Expand Up @@ -1133,6 +1136,8 @@ public void run() {
});
Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);
ReactMarker.logMarker(SETUP_REACT_CONTEXT_END);
// Mark end of bridge loading
ReactMarker.logMarker(ReactMarkerConstants.REACT_BRIDGE_LOADING_END);
reactContext.runOnJSQueueThread(
new Runnable() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ public enum ReactMarkerConstants {
FABRIC_BATCH_EXECUTION_END,
FABRIC_UPDATE_UI_MAIN_THREAD_START,
FABRIC_UPDATE_UI_MAIN_THREAD_END,
// New markers used by bridgeless RN below this line
REACT_INSTANCE_INIT_START,
REACT_INSTANCE_INIT_END
// New markers used by bridge and bridgeless loading below this line
REACT_BRIDGE_LOADING_START,
REACT_BRIDGE_LOADING_END,
REACT_BRIDGELESS_LOADING_START,
REACT_BRIDGELESS_LOADING_END
}

0 comments on commit abf079a

Please sign in to comment.