Skip to content

Commit

Permalink
Add Systrace sections to UIImplementationProvider
Browse files Browse the repository at this point in the history
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
  • Loading branch information
JoshuaGross authored and facebook-github-bot committed Nov 14, 2020
1 parent 66e5367 commit c609952
Showing 1 changed file with 34 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

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}. */
Expand All @@ -20,31 +21,52 @@ public UIImplementation createUIImplementation(
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(
ReactApplicationContext reactContext,
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(
ReactApplicationContext reactContext,
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);
}
}
}

0 comments on commit c609952

Please sign in to comment.