bump up priority of RN threads during startup

Reviewed By: shergin, yungsters

Differential Revision: D5002320

fbshipit-source-id: 8467370940d3742266b3bf319e9a38ae22eab98e
This commit is contained in:
Aaron Chiu
2017-05-05 16:40:46 -07:00
committed by Facebook Github Bot
parent 1dd7bc1515
commit 82c4b9f0b7
3 changed files with 24 additions and 33 deletions

View File

@@ -742,7 +742,7 @@ public class ReactInstanceManager {
@Override
public void run() {
try {
Process.setThreadPriority(Process.THREAD_PRIORITY_DEFAULT);
Process.setThreadPriority(Process.THREAD_PRIORITY_DISPLAY);
final ReactApplicationContext reactApplicationContext = createReactContext(
initParams.getJsExecutorFactory().create(),
initParams.getJsBundleLoader());
@@ -827,6 +827,26 @@ public class ReactInstanceManager {
}
Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);
ReactMarker.logMarker(SETUP_REACT_CONTEXT_END);
mCurrentReactContext.runOnJSQueueThread(new Runnable() {
@Override
public void run() {
Process.setThreadPriority(Process.THREAD_PRIORITY_DEFAULT);
}
});
mCurrentReactContext.runOnNativeModulesQueueThread(new Runnable() {
@Override
public void run() {
Process.setThreadPriority(Process.THREAD_PRIORITY_DEFAULT);
}
});
if (mUseSeparateUIBackgroundThread) {
mCurrentReactContext.runOnUiBackgroundQueueThread(new Runnable() {
@Override
public void run() {
Process.setThreadPriority(Process.THREAD_PRIORITY_DEFAULT);
}
});
}
}
private void attachMeasuredRootViewToInstance(