Skip to content

Commit d4aef08

Browse files
axe-fbfacebook-github-bot
authored andcommitted
Add a marker to indicate when JS thread priority is lowered
Summary: When RN starts up, it lowers the default priority of the JS thread. This diff sets a point to see when the JS thread priority is lowered. In subsequent diffs, we will be able to use this marker to play around with bumping the priority of the JS thread till TTI is done. Reviewed By: alexeylang Differential Revision: D8965457 fbshipit-source-id: 87cb1e3d3b370af183f388c411fd9a87a6cba250
1 parent 1850906 commit d4aef08

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

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

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import static com.facebook.react.bridge.ReactMarkerConstants.REACT_CONTEXT_THREAD_START;
2626
import static com.facebook.react.bridge.ReactMarkerConstants.SETUP_REACT_CONTEXT_END;
2727
import static com.facebook.react.bridge.ReactMarkerConstants.SETUP_REACT_CONTEXT_START;
28+
import static com.facebook.react.bridge.ReactMarkerConstants.CHANGE_THREAD_PRIORITY;
2829
import static com.facebook.react.bridge.ReactMarkerConstants.VM_INIT;
2930
import static com.facebook.react.uimanager.common.UIManagerType.FABRIC;
3031
import static com.facebook.systrace.Systrace.TRACE_TAG_REACT_APPS;
@@ -1024,6 +1025,7 @@ public void run() {
10241025
@Override
10251026
public void run() {
10261027
Process.setThreadPriority(Process.THREAD_PRIORITY_DEFAULT);
1028+
ReactMarker.logMarker(CHANGE_THREAD_PRIORITY, "js_default");
10271029
}
10281030
});
10291031
reactContext.runOnNativeModulesQueueThread(

ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMarkerConstants.java

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public enum ReactMarkerConstants {
2525
NATIVE_MODULE_INITIALIZE_END,
2626
SETUP_REACT_CONTEXT_START,
2727
SETUP_REACT_CONTEXT_END,
28+
CHANGE_THREAD_PRIORITY,
2829
CREATE_UI_MANAGER_MODULE_START,
2930
CREATE_UI_MANAGER_MODULE_END,
3031
CREATE_VIEW_MANAGERS_START,

0 commit comments

Comments
 (0)