Skip to content

Commit

Permalink
Add a marker to indicate when JS thread priority is lowered
Browse files Browse the repository at this point in the history
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
  • Loading branch information
axe-fb authored and facebook-github-bot committed Nov 9, 2018
1 parent 1850906 commit d4aef08
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import static com.facebook.react.bridge.ReactMarkerConstants.REACT_CONTEXT_THREAD_START;
import static com.facebook.react.bridge.ReactMarkerConstants.SETUP_REACT_CONTEXT_END;
import static com.facebook.react.bridge.ReactMarkerConstants.SETUP_REACT_CONTEXT_START;
import static com.facebook.react.bridge.ReactMarkerConstants.CHANGE_THREAD_PRIORITY;
import static com.facebook.react.bridge.ReactMarkerConstants.VM_INIT;
import static com.facebook.react.uimanager.common.UIManagerType.FABRIC;
import static com.facebook.systrace.Systrace.TRACE_TAG_REACT_APPS;
Expand Down Expand Up @@ -1024,6 +1025,7 @@ public void run() {
@Override
public void run() {
Process.setThreadPriority(Process.THREAD_PRIORITY_DEFAULT);
ReactMarker.logMarker(CHANGE_THREAD_PRIORITY, "js_default");
}
});
reactContext.runOnNativeModulesQueueThread(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public enum ReactMarkerConstants {
NATIVE_MODULE_INITIALIZE_END,
SETUP_REACT_CONTEXT_START,
SETUP_REACT_CONTEXT_END,
CHANGE_THREAD_PRIORITY,
CREATE_UI_MANAGER_MODULE_START,
CREATE_UI_MANAGER_MODULE_END,
CREATE_VIEW_MANAGERS_START,
Expand Down

0 comments on commit d4aef08

Please sign in to comment.