Skip to content

Commit 8634ecb

Browse files
sammy-SCmeta-codesync[bot]
authored andcommitted
Remove enableDifferentiatorMutationVectorPreallocation feature flag (#57224)
Summary: Pull Request resolved: #57224 The `enableDifferentiatorMutationVectorPreallocation` flag gated a mutation-vector pre-allocation optimization in the `Differentiator`. It was never ramped and is being removed. The flag defaulted to `false`, so this restores the pre-flag behavior by deleting the gated `reserve(...)` calls (an allocation hint with no effect on diffing results) and keeping the default `mutations.reserve(256)`. Removes the flag definition from `ReactNativeFeatureFlags.config.js`, the gated call sites in `Differentiator.cpp`, and the regenerated feature-flag files (via `yarn featureflags --update`). Changelog: [Internal] Reviewed By: javache Differential Revision: D108411519 fbshipit-source-id: 73844c54627545a111ad2bd83fa09171d87c3396
1 parent ac9cba3 commit 8634ecb

21 files changed

Lines changed: 91 additions & 242 deletions

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<7e91da9df64ce42424101d7d72356c4a>>
7+
* @generated SignedSource<<5307fff9429956a3f3f2f54f2b6b00e7>>
88
*/
99

1010
/**
@@ -132,12 +132,6 @@ public object ReactNativeFeatureFlags {
132132
@JvmStatic
133133
public fun enableDestroyShadowTreeRevisionAsync(): Boolean = accessor.enableDestroyShadowTreeRevisionAsync()
134134

135-
/**
136-
* Pre-allocate mutation vectors in the Differentiator to reduce reallocation overhead during shadow view diffing.
137-
*/
138-
@JvmStatic
139-
public fun enableDifferentiatorMutationVectorPreallocation(): Boolean = accessor.enableDifferentiatorMutationVectorPreallocation()
140-
141135
/**
142136
* When enabled a subset of components will avoid double measurement on Android.
143137
*/

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<3c0e10dee93b76f3e66ca79d26f2b4f2>>
7+
* @generated SignedSource<<d179182254004aa1f5adf671eccb953f>>
88
*/
99

1010
/**
@@ -37,7 +37,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
3737
private var enableCppPropsIteratorSetterCache: Boolean? = null
3838
private var enableCustomFocusSearchOnClippedElementsAndroidCache: Boolean? = null
3939
private var enableDestroyShadowTreeRevisionAsyncCache: Boolean? = null
40-
private var enableDifferentiatorMutationVectorPreallocationCache: Boolean? = null
4140
private var enableDoubleMeasurementFixAndroidCache: Boolean? = null
4241
private var enableEagerRootViewAttachmentCache: Boolean? = null
4342
private var enableExclusivePropsUpdateAndroidCache: Boolean? = null
@@ -262,15 +261,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
262261
return cached
263262
}
264263

265-
override fun enableDifferentiatorMutationVectorPreallocation(): Boolean {
266-
var cached = enableDifferentiatorMutationVectorPreallocationCache
267-
if (cached == null) {
268-
cached = ReactNativeFeatureFlagsCxxInterop.enableDifferentiatorMutationVectorPreallocation()
269-
enableDifferentiatorMutationVectorPreallocationCache = cached
270-
}
271-
return cached
272-
}
273-
274264
override fun enableDoubleMeasurementFixAndroid(): Boolean {
275265
var cached = enableDoubleMeasurementFixAndroidCache
276266
if (cached == null) {

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<e9cc7d01ac1884710f131fbf375f3502>>
7+
* @generated SignedSource<<6dc403c11108a657d48ec9573bee842f>>
88
*/
99

1010
/**
@@ -62,8 +62,6 @@ public object ReactNativeFeatureFlagsCxxInterop {
6262

6363
@DoNotStrip @JvmStatic public external fun enableDestroyShadowTreeRevisionAsync(): Boolean
6464

65-
@DoNotStrip @JvmStatic public external fun enableDifferentiatorMutationVectorPreallocation(): Boolean
66-
6765
@DoNotStrip @JvmStatic public external fun enableDoubleMeasurementFixAndroid(): Boolean
6866

6967
@DoNotStrip @JvmStatic public external fun enableEagerRootViewAttachment(): Boolean

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<ad505c0c71fa0c6e665a218606b596da>>
7+
* @generated SignedSource<<452edce222866440ff3794deb178a7f4>>
88
*/
99

1010
/**
@@ -57,8 +57,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
5757

5858
override fun enableDestroyShadowTreeRevisionAsync(): Boolean = false
5959

60-
override fun enableDifferentiatorMutationVectorPreallocation(): Boolean = false
61-
6260
override fun enableDoubleMeasurementFixAndroid(): Boolean = false
6361

6462
override fun enableEagerRootViewAttachment(): Boolean = false

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<fa85d53197cbdce6b1373fbadf3cf2b9>>
7+
* @generated SignedSource<<8ba7f19e8afe329937b1b36d3b83dbc5>>
88
*/
99

1010
/**
@@ -41,7 +41,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
4141
private var enableCppPropsIteratorSetterCache: Boolean? = null
4242
private var enableCustomFocusSearchOnClippedElementsAndroidCache: Boolean? = null
4343
private var enableDestroyShadowTreeRevisionAsyncCache: Boolean? = null
44-
private var enableDifferentiatorMutationVectorPreallocationCache: Boolean? = null
4544
private var enableDoubleMeasurementFixAndroidCache: Boolean? = null
4645
private var enableEagerRootViewAttachmentCache: Boolean? = null
4746
private var enableExclusivePropsUpdateAndroidCache: Boolean? = null
@@ -283,16 +282,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
283282
return cached
284283
}
285284

286-
override fun enableDifferentiatorMutationVectorPreallocation(): Boolean {
287-
var cached = enableDifferentiatorMutationVectorPreallocationCache
288-
if (cached == null) {
289-
cached = currentProvider.enableDifferentiatorMutationVectorPreallocation()
290-
accessedFeatureFlags.add("enableDifferentiatorMutationVectorPreallocation")
291-
enableDifferentiatorMutationVectorPreallocationCache = cached
292-
}
293-
return cached
294-
}
295-
296285
override fun enableDoubleMeasurementFixAndroid(): Boolean {
297286
var cached = enableDoubleMeasurementFixAndroidCache
298287
if (cached == null) {

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<a460b28871fc3f928dcc2d1a3bf66422>>
7+
* @generated SignedSource<<3a3f9014f644b6b964b50d0974a7b9b5>>
88
*/
99

1010
/**
@@ -57,8 +57,6 @@ public interface ReactNativeFeatureFlagsProvider {
5757

5858
@DoNotStrip public fun enableDestroyShadowTreeRevisionAsync(): Boolean
5959

60-
@DoNotStrip public fun enableDifferentiatorMutationVectorPreallocation(): Boolean
61-
6260
@DoNotStrip public fun enableDoubleMeasurementFixAndroid(): Boolean
6361

6462
@DoNotStrip public fun enableEagerRootViewAttachment(): Boolean

packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<ea8284ad906ae89281a3fbd849e88c19>>
7+
* @generated SignedSource<<70e4f4b4bb3aa28a644ede80ceeb4fc3>>
88
*/
99

1010
/**
@@ -141,12 +141,6 @@ class ReactNativeFeatureFlagsJavaProvider
141141
return method(javaProvider_);
142142
}
143143

144-
bool enableDifferentiatorMutationVectorPreallocation() override {
145-
static const auto method =
146-
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableDifferentiatorMutationVectorPreallocation");
147-
return method(javaProvider_);
148-
}
149-
150144
bool enableDoubleMeasurementFixAndroid() override {
151145
static const auto method =
152146
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableDoubleMeasurementFixAndroid");
@@ -656,11 +650,6 @@ bool JReactNativeFeatureFlagsCxxInterop::enableDestroyShadowTreeRevisionAsync(
656650
return ReactNativeFeatureFlags::enableDestroyShadowTreeRevisionAsync();
657651
}
658652

659-
bool JReactNativeFeatureFlagsCxxInterop::enableDifferentiatorMutationVectorPreallocation(
660-
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
661-
return ReactNativeFeatureFlags::enableDifferentiatorMutationVectorPreallocation();
662-
}
663-
664653
bool JReactNativeFeatureFlagsCxxInterop::enableDoubleMeasurementFixAndroid(
665654
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
666655
return ReactNativeFeatureFlags::enableDoubleMeasurementFixAndroid();
@@ -1093,9 +1082,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
10931082
makeNativeMethod(
10941083
"enableDestroyShadowTreeRevisionAsync",
10951084
JReactNativeFeatureFlagsCxxInterop::enableDestroyShadowTreeRevisionAsync),
1096-
makeNativeMethod(
1097-
"enableDifferentiatorMutationVectorPreallocation",
1098-
JReactNativeFeatureFlagsCxxInterop::enableDifferentiatorMutationVectorPreallocation),
10991085
makeNativeMethod(
11001086
"enableDoubleMeasurementFixAndroid",
11011087
JReactNativeFeatureFlagsCxxInterop::enableDoubleMeasurementFixAndroid),

packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<746da63dcbec1bb165731e7380993659>>
7+
* @generated SignedSource<<19ab9f9ec4e3470290f69e0803ade5d4>>
88
*/
99

1010
/**
@@ -81,9 +81,6 @@ class JReactNativeFeatureFlagsCxxInterop
8181
static bool enableDestroyShadowTreeRevisionAsync(
8282
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
8383

84-
static bool enableDifferentiatorMutationVectorPreallocation(
85-
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
86-
8784
static bool enableDoubleMeasurementFixAndroid(
8885
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
8986

packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<38e26847bb30888adaf6a965dae07cfb>>
7+
* @generated SignedSource<<de5333acce3cebc8c1f88e7d95b111e8>>
88
*/
99

1010
/**
@@ -94,10 +94,6 @@ bool ReactNativeFeatureFlags::enableDestroyShadowTreeRevisionAsync() {
9494
return getAccessor().enableDestroyShadowTreeRevisionAsync();
9595
}
9696

97-
bool ReactNativeFeatureFlags::enableDifferentiatorMutationVectorPreallocation() {
98-
return getAccessor().enableDifferentiatorMutationVectorPreallocation();
99-
}
100-
10197
bool ReactNativeFeatureFlags::enableDoubleMeasurementFixAndroid() {
10298
return getAccessor().enableDoubleMeasurementFixAndroid();
10399
}

packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<6958847f0d788c06cf64478ee2c36386>>
7+
* @generated SignedSource<<9180537aa2031cfcbab5ffbdf1dc32d1>>
88
*/
99

1010
/**
@@ -124,11 +124,6 @@ class ReactNativeFeatureFlags {
124124
*/
125125
RN_EXPORT static bool enableDestroyShadowTreeRevisionAsync();
126126

127-
/**
128-
* Pre-allocate mutation vectors in the Differentiator to reduce reallocation overhead during shadow view diffing.
129-
*/
130-
RN_EXPORT static bool enableDifferentiatorMutationVectorPreallocation();
131-
132127
/**
133128
* When enabled a subset of components will avoid double measurement on Android.
134129
*/

0 commit comments

Comments
 (0)