Add Systrace sections to UIImplementationProvider

Summary:
Add Systrace sections to initialization of non-Fabric UIImplementationProvider. This path is sometimes invoked during startup of Fabric so I'd like to gather more information about its impact.

Changelog: [Internal]

Reviewed By: ejanzer

Differential Revision: D24959965

fbshipit-source-id: a8555b8db284d00f97c71ca859cb2020409cb110
This commit is contained in:
Joshua Gross 2020-11-13 21:51:04 -08:00 коммит произвёл Facebook GitHub Bot
Родитель 66e536739e
Коммит c609952ddb
1 изменённых файлов: 34 добавлений и 12 удалений

Просмотреть файл

@ -9,6 +9,7 @@ package com.facebook.react.uimanager;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.events.EventDispatcher;
import com.facebook.systrace.Systrace;
import java.util.List;
/** Provides UIImplementation to use in {@link UIManagerModule}. */
@ -20,11 +21,17 @@ public class UIImplementationProvider {
UIManagerModule.ViewManagerResolver viewManagerResolver,
EventDispatcher eventDispatcher,
int minTimeLeftInFrameForNonBatchedOperationMs) {
return new UIImplementation(
reactContext,
viewManagerResolver,
eventDispatcher,
minTimeLeftInFrameForNonBatchedOperationMs);
Systrace.beginSection(
Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "UIImplementationProvider.createUIImplementation[1]");
try {
return new UIImplementation(
reactContext,
viewManagerResolver,
eventDispatcher,
minTimeLeftInFrameForNonBatchedOperationMs);
} finally {
Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);
}
}
public UIImplementation createUIImplementation(
@ -32,8 +39,17 @@ public class UIImplementationProvider {
List<ViewManager> viewManagerList,
EventDispatcher eventDispatcher,
int minTimeLeftInFrameForNonBatchedOperationMs) {
return new UIImplementation(
reactContext, viewManagerList, eventDispatcher, minTimeLeftInFrameForNonBatchedOperationMs);
Systrace.beginSection(
Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "UIImplementationProvider.createUIImplementation[2]");
try {
return new UIImplementation(
reactContext,
viewManagerList,
eventDispatcher,
minTimeLeftInFrameForNonBatchedOperationMs);
} finally {
Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);
}
}
UIImplementation createUIImplementation(
@ -41,10 +57,16 @@ public class UIImplementationProvider {
ViewManagerRegistry viewManagerRegistry,
EventDispatcher eventDispatcher,
int minTimeLeftInFrameForNonBatchedOperationMs) {
return new UIImplementation(
reactContext,
viewManagerRegistry,
eventDispatcher,
minTimeLeftInFrameForNonBatchedOperationMs);
Systrace.beginSection(
Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "UIImplementationProvider.createUIImplementation[3]");
try {
return new UIImplementation(
reactContext,
viewManagerRegistry,
eventDispatcher,
minTimeLeftInFrameForNonBatchedOperationMs);
} finally {
Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);
}
}
}