Skip to content

Commit 9962add

Browse files
rubennortefacebook-github-bot
authored andcommitted
Remove redudant fields from ReactNativeStartupTiming (#53711)
Summary: Pull Request resolved: #53711 Changelog: [internal] This removes some fields that contain the same time as `endTime`, which is confusing when documenting them. Reviewed By: christophpurrer Differential Revision: D82112473 fbshipit-source-id: 461e2b4b495ae641dcb3233874360a4f7b90dabf
1 parent c015f62 commit 9962add

File tree

4 files changed

+5
-45
lines changed

4 files changed

+5
-45
lines changed

packages/react-native/ReactCommon/react/nativemodule/webperformance/NativePerformance.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -283,15 +283,6 @@ NativePerformance::getReactNativeStartupTiming(jsi::Runtime& /*rt*/) {
283283
startupLogger.getRunJSBundleStartTime();
284284
}
285285

286-
if (!std::isnan(startupLogger.getRunJSBundleEndTime())) {
287-
result["executeJavaScriptBundleEntryPointEnd"] =
288-
startupLogger.getRunJSBundleEndTime();
289-
}
290-
291-
if (!std::isnan(startupLogger.getInitReactRuntimeEndTime())) {
292-
result["initializeRuntimeEnd"] = startupLogger.getInitReactRuntimeEndTime();
293-
}
294-
295286
if (!std::isnan(startupLogger.getAppStartupEndTime())) {
296287
result["endTime"] = startupLogger.getAppStartupEndTime();
297288
}

packages/react-native/src/private/webapis/performance/Performance.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,19 +128,15 @@ export default class Performance {
128128
get rnStartupTiming(): ReactNativeStartupTiming {
129129
const {
130130
startTime,
131-
endTime,
132131
initializeRuntimeStart,
133-
initializeRuntimeEnd,
134132
executeJavaScriptBundleEntryPointStart,
135-
executeJavaScriptBundleEntryPointEnd,
133+
endTime,
136134
} = NativePerformance.getReactNativeStartupTiming();
137135
return new ReactNativeStartupTiming({
138136
startTime,
139-
endTime,
140137
initializeRuntimeStart,
141-
initializeRuntimeEnd,
142138
executeJavaScriptBundleEntryPointStart,
143-
executeJavaScriptBundleEntryPointEnd,
139+
endTime,
144140
});
145141
}
146142

packages/react-native/src/private/webapis/performance/ReactNativeStartupTiming.js

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ type ReactNativeStartupTimingLike = {
1616
startTime: ?number,
1717
endTime: ?number,
1818
initializeRuntimeStart: ?number,
19-
initializeRuntimeEnd: ?number,
2019
executeJavaScriptBundleEntryPointStart: ?number,
21-
executeJavaScriptBundleEntryPointEnd: ?number,
2220
};
2321

2422
// Read-only object with RN startup timing information.
@@ -29,22 +27,17 @@ export default class ReactNativeStartupTiming {
2927
// 1. The `ReactNativeStartupTiming` is non-standard API
3028
// 2. The timing information is relative to the time origin, which means `0` has valid meaning
3129
#startTime: ?number;
32-
#endTime: ?number;
3330
#initializeRuntimeStart: ?number;
34-
#initializeRuntimeEnd: ?number;
3531
#executeJavaScriptBundleEntryPointStart: ?number;
36-
#executeJavaScriptBundleEntryPointEnd: ?number;
32+
#endTime: ?number;
3733

3834
constructor(startUpTiming: ?ReactNativeStartupTimingLike) {
3935
if (startUpTiming != null) {
4036
this.#startTime = startUpTiming.startTime;
41-
this.#endTime = startUpTiming.endTime;
4237
this.#initializeRuntimeStart = startUpTiming.initializeRuntimeStart;
43-
this.#initializeRuntimeEnd = startUpTiming.initializeRuntimeEnd;
4438
this.#executeJavaScriptBundleEntryPointStart =
4539
startUpTiming.executeJavaScriptBundleEntryPointStart;
46-
this.#executeJavaScriptBundleEntryPointEnd =
47-
startUpTiming.executeJavaScriptBundleEntryPointEnd;
40+
this.#endTime = startUpTiming.endTime;
4841
}
4942
}
5043

@@ -56,7 +49,7 @@ export default class ReactNativeStartupTiming {
5649
}
5750

5851
/**
59-
* End time of the RN app startup process. This is equal to `executeJavaScriptBundleEntryPointEnd`.
52+
* End time of the RN app startup process.
6053
*/
6154
get endTime(): ?number {
6255
return this.#endTime;
@@ -69,26 +62,12 @@ export default class ReactNativeStartupTiming {
6962
return this.#initializeRuntimeStart;
7063
}
7164

72-
/**
73-
* End time when RN runtime get initialized. This is the last marker before ends of the app startup process.
74-
*/
75-
get initializeRuntimeEnd(): ?number {
76-
return this.#initializeRuntimeEnd;
77-
}
78-
7965
/**
8066
* Start time of JS bundle being executed. This indicates the RN JS bundle is loaded and start to be evaluated.
8167
*/
8268
get executeJavaScriptBundleEntryPointStart(): ?number {
8369
return this.#executeJavaScriptBundleEntryPointStart;
8470
}
85-
86-
/**
87-
* End time of JS bundle being executed. This indicates all the synchronous entry point jobs are finished.
88-
*/
89-
get executeJavaScriptBundleEntryPointEnd(): ?number {
90-
return this.#executeJavaScriptBundleEntryPointEnd;
91-
}
9271
}
9372

9473
setPlatformObject(ReactNativeStartupTiming);

packages/rn-tester/js/examples/Performance/PerformanceApiExample.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,6 @@ function StartupTimingExample(): React.Node {
7272
startUpTiming?.executeJavaScriptBundleEntryPointStart,
7373
)} ms`}
7474
</RNTesterText>
75-
<RNTesterText>{`executeJavaScriptBundleEntryPointEnd: ${String(
76-
startUpTiming?.executeJavaScriptBundleEntryPointEnd,
77-
)} ms`}</RNTesterText>
78-
<RNTesterText>{`initializeRuntimeEnd: ${String(
79-
startUpTiming?.initializeRuntimeEnd,
80-
)} ms`}</RNTesterText>
8175
<RNTesterText>{`endTime: ${String(startUpTiming?.endTime)} ms`}</RNTesterText>
8276
</View>
8377
</View>

0 commit comments

Comments
 (0)