Skip to content

Commit 2ad853a

Browse files
committed
Add feature flags for expiration times (#27821)
It seems worthwhile to me to run a test to experiment with different expiration times. This moves the expiration times for scheduler and reconciler into FeatureFlags for the facebook build. Non-facebook should not be affected by these changes. DiffTrain build for commit 0cdfef1.
1 parent 51cc16a commit 2ad853a

File tree

10 files changed

+41
-35
lines changed

10 files changed

+41
-35
lines changed

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<ad4f3cc032aebbca30e14b6cadc89a2a>>
10+
* @generated SignedSource<<1664f9f3eec9720b0472e436e7889c65>>
1111
*/
1212

1313
"use strict";
@@ -143,6 +143,8 @@ if (__DEV__) {
143143
var enableProfilerCommitHooks = true;
144144
var enableProfilerNestedUpdatePhase = true;
145145
var createRootStrictEffectsByDefault = false;
146+
var syncLaneExpirationMs = 250;
147+
var transitionLaneExpirationMs = 5000;
146148
var enableLazyContextPropagation = false;
147149
var enableLegacyHidden = false;
148150
var enableAsyncActions = true;
@@ -1389,7 +1391,7 @@ if (__DEV__) {
13891391
// to fix the starvation. However, this scenario supports the idea that
13901392
// expiration times are an important safeguard when starvation
13911393
// does happen.
1392-
return currentTime + 250;
1394+
return currentTime + syncLaneExpirationMs;
13931395

13941396
case DefaultHydrationLane:
13951397
case DefaultLane:
@@ -1409,7 +1411,7 @@ if (__DEV__) {
14091411
case TransitionLane13:
14101412
case TransitionLane14:
14111413
case TransitionLane15:
1412-
return currentTime + 5000;
1414+
return currentTime + transitionLaneExpirationMs;
14131415

14141416
case RetryLane1:
14151417
case RetryLane2:
@@ -25474,7 +25476,7 @@ if (__DEV__) {
2547425476
return root;
2547525477
}
2547625478

25477-
var ReactVersion = "18.3.0-canary-40f653d13-20231208";
25479+
var ReactVersion = "18.3.0-canary-0cdfef19b-20231211";
2547825480

2547925481
// Might add PROFILE later.
2548025482

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9083,7 +9083,7 @@ var devToolsConfig$jscomp$inline_1033 = {
90839083
throw Error("TestRenderer does not support findFiberByHostInstance()");
90849084
},
90859085
bundleType: 0,
9086-
version: "18.3.0-canary-40f653d13-20231208",
9086+
version: "18.3.0-canary-0cdfef19b-20231211",
90879087
rendererPackageName: "react-test-renderer"
90889088
};
90899089
var internals$jscomp$inline_1226 = {
@@ -9114,7 +9114,7 @@ var internals$jscomp$inline_1226 = {
91149114
scheduleRoot: null,
91159115
setRefreshHandler: null,
91169116
getCurrentFiber: null,
9117-
reconcilerVersion: "18.3.0-canary-40f653d13-20231208"
9117+
reconcilerVersion: "18.3.0-canary-0cdfef19b-20231211"
91189118
};
91199119
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
91209120
var hook$jscomp$inline_1227 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9509,7 +9509,7 @@ var devToolsConfig$jscomp$inline_1075 = {
95099509
throw Error("TestRenderer does not support findFiberByHostInstance()");
95109510
},
95119511
bundleType: 0,
9512-
version: "18.3.0-canary-40f653d13-20231208",
9512+
version: "18.3.0-canary-0cdfef19b-20231211",
95139513
rendererPackageName: "react-test-renderer"
95149514
};
95159515
var internals$jscomp$inline_1267 = {
@@ -9540,7 +9540,7 @@ var internals$jscomp$inline_1267 = {
95409540
scheduleRoot: null,
95419541
setRefreshHandler: null,
95429542
getCurrentFiber: null,
9543-
reconcilerVersion: "18.3.0-canary-40f653d13-20231208"
9543+
reconcilerVersion: "18.3.0-canary-0cdfef19b-20231211"
95449544
};
95459545
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
95469546
var hook$jscomp$inline_1268 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if (__DEV__) {
2424
) {
2525
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
2626
}
27-
var ReactVersion = "18.3.0-canary-40f653d13-20231208";
27+
var ReactVersion = "18.3.0-canary-0cdfef19b-20231211";
2828

2929
// ATTENTION
3030
// When adding new symbols to this file,

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,4 +580,4 @@ exports.useSyncExternalStore = function (
580580
exports.useTransition = function () {
581581
return ReactCurrentDispatcher.current.useTransition();
582582
};
583-
exports.version = "18.3.0-canary-40f653d13-20231208";
583+
exports.version = "18.3.0-canary-0cdfef19b-20231211";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-profiling.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ exports.useSyncExternalStore = function (
576576
exports.useTransition = function () {
577577
return ReactCurrentDispatcher.current.useTransition();
578578
};
579-
exports.version = "18.3.0-canary-40f653d13-20231208";
579+
exports.version = "18.3.0-canary-0cdfef19b-20231211";
580580
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
581581
"function" ===
582582
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/scheduler/cjs/Scheduler-dev.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<b5166dda44630360fc480305ba7e416f>>
10+
* @generated SignedSource<<329119982dc400f73a57d3f8fddc6fb4>>
1111
*/
1212

1313
"use strict";
@@ -27,6 +27,9 @@ if (__DEV__) {
2727
var enableSchedulerDebugging = false;
2828
var enableProfiling = false;
2929
var frameYieldMs = 5;
30+
var userBlockingPriorityTimeout = 250;
31+
var normalPriorityTimeout = 5000;
32+
var lowPriorityTimeout = 10000;
3033

3134
function push(heap, node) {
3235
var index = heap.length;
@@ -140,15 +143,7 @@ if (__DEV__) {
140143
// Math.pow(2, 30) - 1
141144
// 0b111111111111111111111111111111
142145

143-
var maxSigned31BitInt = 1073741823; // Times out immediately
144-
145-
var IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out
146-
147-
var USER_BLOCKING_PRIORITY_TIMEOUT = 250;
148-
var NORMAL_PRIORITY_TIMEOUT = 5000;
149-
var LOW_PRIORITY_TIMEOUT = 10000; // Never times out
150-
151-
var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt; // Tasks are stored on a min heap
146+
var maxSigned31BitInt = 1073741823; // Tasks are stored on a min heap
152147

153148
var taskQueue = [];
154149
var timerQueue = []; // Incrementing id counter. Used to maintain insertion order.
@@ -389,24 +384,29 @@ if (__DEV__) {
389384

390385
switch (priorityLevel) {
391386
case ImmediatePriority:
392-
timeout = IMMEDIATE_PRIORITY_TIMEOUT;
387+
// Times out immediately
388+
timeout = -1;
393389
break;
394390

395391
case UserBlockingPriority:
396-
timeout = USER_BLOCKING_PRIORITY_TIMEOUT;
392+
// Eventually times out
393+
timeout = userBlockingPriorityTimeout;
397394
break;
398395

399396
case IdlePriority:
400-
timeout = IDLE_PRIORITY_TIMEOUT;
397+
// Never times out
398+
timeout = maxSigned31BitInt;
401399
break;
402400

403401
case LowPriority:
404-
timeout = LOW_PRIORITY_TIMEOUT;
402+
// Eventually times out
403+
timeout = lowPriorityTimeout;
405404
break;
406405

407406
case NormalPriority:
408407
default:
409-
timeout = NORMAL_PRIORITY_TIMEOUT;
408+
// Eventually times out
409+
timeout = normalPriorityTimeout;
410410
break;
411411
}
412412

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
40f653d13c363c6f81b13de67ce391991fb1f870
1+
0cdfef19b96cc6202d48e0812b5069c286d12b04

compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<0eeeeee026384142a193e40e419beebc>>
10+
* @generated SignedSource<<d6497ddb8ae55cb2111984b005a7ec04>>
1111
*/
1212

1313
"use strict";
@@ -3245,6 +3245,8 @@ to return true:wantsResponderID| |
32453245
var enableProfilerTimer = true;
32463246
var enableProfilerCommitHooks = true;
32473247
var enableProfilerNestedUpdatePhase = true;
3248+
var syncLaneExpirationMs = 250;
3249+
var transitionLaneExpirationMs = 5000;
32483250
var createRootStrictEffectsByDefault = false;
32493251
var enableLazyContextPropagation = false;
32503252
var enableAsyncActions = false;
@@ -4378,7 +4380,7 @@ to return true:wantsResponderID| |
43784380
// to fix the starvation. However, this scenario supports the idea that
43794381
// expiration times are an important safeguard when starvation
43804382
// does happen.
4381-
return currentTime + 250;
4383+
return currentTime + syncLaneExpirationMs;
43824384

43834385
case DefaultHydrationLane:
43844386
case DefaultLane:
@@ -4398,7 +4400,7 @@ to return true:wantsResponderID| |
43984400
case TransitionLane13:
43994401
case TransitionLane14:
44004402
case TransitionLane15:
4401-
return currentTime + 5000;
4403+
return currentTime + transitionLaneExpirationMs;
44024404

44034405
case RetryLane1:
44044406
case RetryLane2:
@@ -27767,7 +27769,7 @@ to return true:wantsResponderID| |
2776727769
return root;
2776827770
}
2776927771

27770-
var ReactVersion = "18.3.0-canary-48315039";
27772+
var ReactVersion = "18.3.0-canary-165712d4";
2777127773

2777227774
function createPortal$1(
2777327775
children,

compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<dfd02eaf29e944e9f458476582b7ac96>>
10+
* @generated SignedSource<<8bffe72f6c7ee5bca8e6688740fa89a4>>
1111
*/
1212

1313
"use strict";
@@ -2953,6 +2953,8 @@ to return true:wantsResponderID| |
29532953
var enableProfilerTimer = true;
29542954
var enableProfilerCommitHooks = true;
29552955
var enableProfilerNestedUpdatePhase = true;
2956+
var syncLaneExpirationMs = 250;
2957+
var transitionLaneExpirationMs = 5000;
29562958
var createRootStrictEffectsByDefault = false;
29572959
var enableLazyContextPropagation = false;
29582960
var enableAsyncActions = false;
@@ -5255,7 +5257,7 @@ to return true:wantsResponderID| |
52555257
// to fix the starvation. However, this scenario supports the idea that
52565258
// expiration times are an important safeguard when starvation
52575259
// does happen.
5258-
return currentTime + 250;
5260+
return currentTime + syncLaneExpirationMs;
52595261

52605262
case DefaultHydrationLane:
52615263
case DefaultLane:
@@ -5275,7 +5277,7 @@ to return true:wantsResponderID| |
52755277
case TransitionLane13:
52765278
case TransitionLane14:
52775279
case TransitionLane15:
5278-
return currentTime + 5000;
5280+
return currentTime + transitionLaneExpirationMs;
52795281

52805282
case RetryLane1:
52815283
case RetryLane2:
@@ -28208,7 +28210,7 @@ to return true:wantsResponderID| |
2820828210
return root;
2820928211
}
2821028212

28211-
var ReactVersion = "18.3.0-canary-0ae2c000";
28213+
var ReactVersion = "18.3.0-canary-00e6ae33";
2821228214

2821328215
function createPortal$1(
2821428216
children,

0 commit comments

Comments
 (0)