Skip to content

Commit

Permalink
Clean up the enableEarlyReturnForPropDiffing experiment (#29041)
Browse files Browse the repository at this point in the history
## Summary

The experiment has shown no significant performance changes. This PR
removes it.

## How did you test this change?
```
yarn flow native
yarn lint
```

DiffTrain build for commit 2c022b8.
  • Loading branch information
dmytrorykun committed May 10, 2024
1 parent 0952db3 commit 8290a1f
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 93 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
151cce37401dc2ff609701119d61a17d92fce4ab
2c022b847ed2171c59d37db9f71b394e0082ae3f
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<577c7636235832d840ad016860b50817>>
* @generated SignedSource<<992be7ad266e7af316abc8834205d869>>
*/

'use strict';
Expand Down Expand Up @@ -1995,7 +1995,6 @@ var alwaysThrottleRetries = dynamicFlags.alwaysThrottleRetries,
disableStringRefs = dynamicFlags.disableStringRefs,
enableAddPropertiesFastPath = dynamicFlags.enableAddPropertiesFastPath,
enableDeferRootSchedulingToMicrotask = dynamicFlags.enableDeferRootSchedulingToMicrotask,
enableEarlyReturnForPropDiffing = dynamicFlags.enableEarlyReturnForPropDiffing,
enableInfiniteRenderLoopDetection = dynamicFlags.enableInfiniteRenderLoopDetection,
enableRefAsProp = dynamicFlags.enableRefAsProp,
enableUnifiedSyncLane = dynamicFlags.enableUnifiedSyncLane,
Expand Down Expand Up @@ -2436,12 +2435,6 @@ function create(props, validAttributes) {
props, validAttributes);
}
function diff(prevProps, nextProps, validAttributes) {
if (enableEarlyReturnForPropDiffing) {
if (prevProps === nextProps) {
return null; // no change
}
}

return diffProperties(null, // updatePayload
prevProps, nextProps, validAttributes);
}
Expand Down Expand Up @@ -26095,7 +26088,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
return root;
}

var ReactVersion = '19.0.0-beta-83bc2843';
var ReactVersion = '19.0.0-beta-8cbbbfb0';

/*
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<844a7fde793a6bcbd87492fec25685e4>>
* @generated SignedSource<<bf7fa797d0242d954cf0ad22f15590ac>>
*/

"use strict";
Expand Down Expand Up @@ -974,8 +974,6 @@ var alwaysThrottleRetries = dynamicFlagsUntyped.alwaysThrottleRetries,
enableAddPropertiesFastPath = dynamicFlagsUntyped.enableAddPropertiesFastPath,
enableDeferRootSchedulingToMicrotask =
dynamicFlagsUntyped.enableDeferRootSchedulingToMicrotask,
enableEarlyReturnForPropDiffing =
dynamicFlagsUntyped.enableEarlyReturnForPropDiffing,
enableInfiniteRenderLoopDetection =
dynamicFlagsUntyped.enableInfiniteRenderLoopDetection,
enableRefAsProp = dynamicFlagsUntyped.enableRefAsProp,
Expand Down Expand Up @@ -7297,15 +7295,12 @@ function completeWork(current, workInProgress, renderLanes) {
: createChildNodeSet()),
appendAllChildrenToContainer(newChildSet, workInProgress, !1, !1));
b: {
oldProps =
enableEarlyReturnForPropDiffing && oldProps === newProps
? null
: diffProperties(
null,
oldProps,
newProps,
renderLanes.canonical.viewConfig.validAttributes
);
oldProps = diffProperties(
null,
oldProps,
newProps,
renderLanes.canonical.viewConfig.validAttributes
);
renderLanes.canonical.currentProps = newProps;
newProps = renderLanes.node;
if (current)
Expand Down Expand Up @@ -10589,7 +10584,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1124 = {
findFiberByHostInstance: getInstanceFromNode,
bundleType: 0,
version: "19.0.0-beta-bdce1f91",
version: "19.0.0-beta-0e5aa221",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForInstance: getInspectorDataForInstance,
Expand Down Expand Up @@ -10632,7 +10627,7 @@ var internals$jscomp$inline_1356 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-beta-bdce1f91"
reconcilerVersion: "19.0.0-beta-0e5aa221"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1357 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<d71fe8fc880922e5df9a2a0cbab38d57>>
* @generated SignedSource<<79240e3cc80ad4ba1c6a4a8fd2e22e28>>
*/

"use strict";
Expand Down Expand Up @@ -978,8 +978,6 @@ var alwaysThrottleRetries = dynamicFlagsUntyped.alwaysThrottleRetries,
enableAddPropertiesFastPath = dynamicFlagsUntyped.enableAddPropertiesFastPath,
enableDeferRootSchedulingToMicrotask =
dynamicFlagsUntyped.enableDeferRootSchedulingToMicrotask,
enableEarlyReturnForPropDiffing =
dynamicFlagsUntyped.enableEarlyReturnForPropDiffing,
enableInfiniteRenderLoopDetection =
dynamicFlagsUntyped.enableInfiniteRenderLoopDetection,
enableRefAsProp = dynamicFlagsUntyped.enableRefAsProp,
Expand Down Expand Up @@ -7563,15 +7561,12 @@ function completeWork(current, workInProgress, renderLanes) {
: createChildNodeSet()),
appendAllChildrenToContainer(newChildSet, workInProgress, !1, !1));
b: {
oldProps =
enableEarlyReturnForPropDiffing && oldProps === newProps
? null
: diffProperties(
null,
oldProps,
newProps,
renderLanes.canonical.viewConfig.validAttributes
);
oldProps = diffProperties(
null,
oldProps,
newProps,
renderLanes.canonical.viewConfig.validAttributes
);
renderLanes.canonical.currentProps = newProps;
newProps = renderLanes.node;
if (current)
Expand Down Expand Up @@ -11294,7 +11289,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1204 = {
findFiberByHostInstance: getInstanceFromNode,
bundleType: 0,
version: "19.0.0-beta-13e56181",
version: "19.0.0-beta-6dfa24ac",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForInstance: getInspectorDataForInstance,
Expand Down Expand Up @@ -11350,7 +11345,7 @@ var roots = new Map(),
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-beta-13e56181"
reconcilerVersion: "19.0.0-beta-6dfa24ac"
});
exports.createPortal = function (children, containerTag) {
return createPortal$1(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<b948a7523c731b45fbc28f4bfeb2bf96>>
* @generated SignedSource<<c616f3c5557c8235bca7c732a1bd4ad9>>
*/

'use strict';
Expand Down Expand Up @@ -2342,7 +2342,6 @@ var alwaysThrottleRetries = dynamicFlags.alwaysThrottleRetries,
disableDefaultPropsExceptForClasses = dynamicFlags.disableDefaultPropsExceptForClasses,
disableStringRefs = dynamicFlags.disableStringRefs,
enableDeferRootSchedulingToMicrotask = dynamicFlags.enableDeferRootSchedulingToMicrotask,
enableEarlyReturnForPropDiffing = dynamicFlags.enableEarlyReturnForPropDiffing,
enableInfiniteRenderLoopDetection = dynamicFlags.enableInfiniteRenderLoopDetection,
enableRefAsProp = dynamicFlags.enableRefAsProp,
enableUnifiedSyncLane = dynamicFlags.enableUnifiedSyncLane;
Expand Down Expand Up @@ -3391,12 +3390,6 @@ function create(props, validAttributes) {
props, validAttributes);
}
function diff(prevProps, nextProps, validAttributes) {
if (enableEarlyReturnForPropDiffing) {
if (prevProps === nextProps) {
return null; // no change
}
}

return diffProperties(null, // updatePayload
prevProps, nextProps, validAttributes);
}
Expand Down Expand Up @@ -26445,7 +26438,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
return root;
}

var ReactVersion = '19.0.0-beta-303370bf';
var ReactVersion = '19.0.0-beta-ddb899dd';

/*
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<9218133e45a38bee509673d882f7b469>>
* @generated SignedSource<<40e897e52212d86ac96cac9227ed5e6e>>
*/

"use strict";
Expand Down Expand Up @@ -1118,8 +1118,6 @@ var alwaysThrottleRetries = dynamicFlagsUntyped.alwaysThrottleRetries,
disableStringRefs = dynamicFlagsUntyped.disableStringRefs,
enableDeferRootSchedulingToMicrotask =
dynamicFlagsUntyped.enableDeferRootSchedulingToMicrotask,
enableEarlyReturnForPropDiffing =
dynamicFlagsUntyped.enableEarlyReturnForPropDiffing,
enableInfiniteRenderLoopDetection =
dynamicFlagsUntyped.enableInfiniteRenderLoopDetection,
enableRefAsProp = dynamicFlagsUntyped.enableRefAsProp,
Expand Down Expand Up @@ -8300,15 +8298,12 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
try {
var viewConfig = flags.viewConfig;
instanceProps.set(flags._nativeTag, newProps);
var updatePayload =
enableEarlyReturnForPropDiffing && current === newProps
? null
: diffProperties(
null,
current,
newProps,
viewConfig.validAttributes
);
var updatePayload = diffProperties(
null,
current,
newProps,
viewConfig.validAttributes
);
null != updatePayload &&
ReactNativePrivateInterface.UIManager.updateView(
flags._nativeTag,
Expand Down Expand Up @@ -8425,15 +8420,12 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
prevProps = assign({}, props, {
style: [props.style, { display: "none" }]
});
var updatePayload$jscomp$1 =
enableEarlyReturnForPropDiffing && prevProps === props
? null
: diffProperties(
null,
prevProps,
props,
viewConfig$jscomp$1.validAttributes
);
var updatePayload$jscomp$1 = diffProperties(
null,
prevProps,
props,
viewConfig$jscomp$1.validAttributes
);
ReactNativePrivateInterface.UIManager.updateView(
instance._nativeTag,
viewConfig$jscomp$1.uiViewClassName,
Expand Down Expand Up @@ -10781,7 +10773,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1192 = {
findFiberByHostInstance: getInstanceFromTag,
bundleType: 0,
version: "19.0.0-beta-11cf708a",
version: "19.0.0-beta-f099a637",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForInstance: getInspectorDataForInstance,
Expand Down Expand Up @@ -10824,7 +10816,7 @@ var internals$jscomp$inline_1441 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-beta-11cf708a"
reconcilerVersion: "19.0.0-beta-f099a637"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1442 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<7ec40d981bbcdacc39e55becc570911b>>
* @generated SignedSource<<82d14dcd5e1babbe3578eee9ac16e1a9>>
*/

"use strict";
Expand Down Expand Up @@ -1122,8 +1122,6 @@ var alwaysThrottleRetries = dynamicFlagsUntyped.alwaysThrottleRetries,
disableStringRefs = dynamicFlagsUntyped.disableStringRefs,
enableDeferRootSchedulingToMicrotask =
dynamicFlagsUntyped.enableDeferRootSchedulingToMicrotask,
enableEarlyReturnForPropDiffing =
dynamicFlagsUntyped.enableEarlyReturnForPropDiffing,
enableInfiniteRenderLoopDetection =
dynamicFlagsUntyped.enableInfiniteRenderLoopDetection,
enableRefAsProp = dynamicFlagsUntyped.enableRefAsProp,
Expand Down Expand Up @@ -8783,15 +8781,12 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
try {
var viewConfig = flags.viewConfig;
instanceProps.set(flags._nativeTag, newProps);
var updatePayload =
enableEarlyReturnForPropDiffing && current === newProps
? null
: diffProperties(
null,
current,
newProps,
viewConfig.validAttributes
);
var updatePayload = diffProperties(
null,
current,
newProps,
viewConfig.validAttributes
);
null != updatePayload &&
ReactNativePrivateInterface.UIManager.updateView(
flags._nativeTag,
Expand Down Expand Up @@ -8908,15 +8903,12 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
prevProps = assign({}, props, {
style: [props.style, { display: "none" }]
});
var updatePayload$jscomp$1 =
enableEarlyReturnForPropDiffing && prevProps === props
? null
: diffProperties(
null,
prevProps,
props,
viewConfig$jscomp$1.validAttributes
);
var updatePayload$jscomp$1 = diffProperties(
null,
prevProps,
props,
viewConfig$jscomp$1.validAttributes
);
ReactNativePrivateInterface.UIManager.updateView(
instance._nativeTag,
viewConfig$jscomp$1.uiViewClassName,
Expand Down Expand Up @@ -11487,7 +11479,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1272 = {
findFiberByHostInstance: getInstanceFromTag,
bundleType: 0,
version: "19.0.0-beta-fa7474ba",
version: "19.0.0-beta-203d3842",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForInstance: getInspectorDataForInstance,
Expand Down Expand Up @@ -11543,7 +11535,7 @@ var roots = new Map(),
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-beta-fa7474ba"
reconcilerVersion: "19.0.0-beta-203d3842"
});
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
computeComponentStackForErrorReporting: function (reactTag) {
Expand Down

0 comments on commit 8290a1f

Please sign in to comment.