mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Remove redudant fields from ReactNativeStartupTiming (#53711)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/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
This commit is contained in:
committed by
Vitali Zaidman
parent
5f1a22ac8d
commit
bf9c6514fc
-9
@@ -283,15 +283,6 @@ NativePerformance::getReactNativeStartupTiming(jsi::Runtime& /*rt*/) {
|
||||
startupLogger.getRunJSBundleStartTime();
|
||||
}
|
||||
|
||||
if (!std::isnan(startupLogger.getRunJSBundleEndTime())) {
|
||||
result["executeJavaScriptBundleEntryPointEnd"] =
|
||||
startupLogger.getRunJSBundleEndTime();
|
||||
}
|
||||
|
||||
if (!std::isnan(startupLogger.getInitReactRuntimeEndTime())) {
|
||||
result["initializeRuntimeEnd"] = startupLogger.getInitReactRuntimeEndTime();
|
||||
}
|
||||
|
||||
if (!std::isnan(startupLogger.getAppStartupEndTime())) {
|
||||
result["endTime"] = startupLogger.getAppStartupEndTime();
|
||||
}
|
||||
|
||||
@@ -128,19 +128,15 @@ export default class Performance {
|
||||
get rnStartupTiming(): ReactNativeStartupTiming {
|
||||
const {
|
||||
startTime,
|
||||
endTime,
|
||||
initializeRuntimeStart,
|
||||
initializeRuntimeEnd,
|
||||
executeJavaScriptBundleEntryPointStart,
|
||||
executeJavaScriptBundleEntryPointEnd,
|
||||
endTime,
|
||||
} = NativePerformance.getReactNativeStartupTiming();
|
||||
return new ReactNativeStartupTiming({
|
||||
startTime,
|
||||
endTime,
|
||||
initializeRuntimeStart,
|
||||
initializeRuntimeEnd,
|
||||
executeJavaScriptBundleEntryPointStart,
|
||||
executeJavaScriptBundleEntryPointEnd,
|
||||
endTime,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+3
-24
@@ -16,9 +16,7 @@ type ReactNativeStartupTimingLike = {
|
||||
startTime: ?number,
|
||||
endTime: ?number,
|
||||
initializeRuntimeStart: ?number,
|
||||
initializeRuntimeEnd: ?number,
|
||||
executeJavaScriptBundleEntryPointStart: ?number,
|
||||
executeJavaScriptBundleEntryPointEnd: ?number,
|
||||
};
|
||||
|
||||
// Read-only object with RN startup timing information.
|
||||
@@ -29,22 +27,17 @@ export default class ReactNativeStartupTiming {
|
||||
// 1. The `ReactNativeStartupTiming` is non-standard API
|
||||
// 2. The timing information is relative to the time origin, which means `0` has valid meaning
|
||||
#startTime: ?number;
|
||||
#endTime: ?number;
|
||||
#initializeRuntimeStart: ?number;
|
||||
#initializeRuntimeEnd: ?number;
|
||||
#executeJavaScriptBundleEntryPointStart: ?number;
|
||||
#executeJavaScriptBundleEntryPointEnd: ?number;
|
||||
#endTime: ?number;
|
||||
|
||||
constructor(startUpTiming: ?ReactNativeStartupTimingLike) {
|
||||
if (startUpTiming != null) {
|
||||
this.#startTime = startUpTiming.startTime;
|
||||
this.#endTime = startUpTiming.endTime;
|
||||
this.#initializeRuntimeStart = startUpTiming.initializeRuntimeStart;
|
||||
this.#initializeRuntimeEnd = startUpTiming.initializeRuntimeEnd;
|
||||
this.#executeJavaScriptBundleEntryPointStart =
|
||||
startUpTiming.executeJavaScriptBundleEntryPointStart;
|
||||
this.#executeJavaScriptBundleEntryPointEnd =
|
||||
startUpTiming.executeJavaScriptBundleEntryPointEnd;
|
||||
this.#endTime = startUpTiming.endTime;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +49,7 @@ export default class ReactNativeStartupTiming {
|
||||
}
|
||||
|
||||
/**
|
||||
* End time of the RN app startup process. This is equal to `executeJavaScriptBundleEntryPointEnd`.
|
||||
* End time of the RN app startup process.
|
||||
*/
|
||||
get endTime(): ?number {
|
||||
return this.#endTime;
|
||||
@@ -69,26 +62,12 @@ export default class ReactNativeStartupTiming {
|
||||
return this.#initializeRuntimeStart;
|
||||
}
|
||||
|
||||
/**
|
||||
* End time when RN runtime get initialized. This is the last marker before ends of the app startup process.
|
||||
*/
|
||||
get initializeRuntimeEnd(): ?number {
|
||||
return this.#initializeRuntimeEnd;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start time of JS bundle being executed. This indicates the RN JS bundle is loaded and start to be evaluated.
|
||||
*/
|
||||
get executeJavaScriptBundleEntryPointStart(): ?number {
|
||||
return this.#executeJavaScriptBundleEntryPointStart;
|
||||
}
|
||||
|
||||
/**
|
||||
* End time of JS bundle being executed. This indicates all the synchronous entry point jobs are finished.
|
||||
*/
|
||||
get executeJavaScriptBundleEntryPointEnd(): ?number {
|
||||
return this.#executeJavaScriptBundleEntryPointEnd;
|
||||
}
|
||||
}
|
||||
|
||||
setPlatformObject(ReactNativeStartupTiming);
|
||||
|
||||
@@ -72,12 +72,6 @@ function StartupTimingExample(): React.Node {
|
||||
startUpTiming?.executeJavaScriptBundleEntryPointStart,
|
||||
)} ms`}
|
||||
</RNTesterText>
|
||||
<RNTesterText>{`executeJavaScriptBundleEntryPointEnd: ${String(
|
||||
startUpTiming?.executeJavaScriptBundleEntryPointEnd,
|
||||
)} ms`}</RNTesterText>
|
||||
<RNTesterText>{`initializeRuntimeEnd: ${String(
|
||||
startUpTiming?.initializeRuntimeEnd,
|
||||
)} ms`}</RNTesterText>
|
||||
<RNTesterText>{`endTime: ${String(startUpTiming?.endTime)} ms`}</RNTesterText>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
Reference in New Issue
Block a user