Skip to content

Commit 0d0ce18

Browse files
committed
Lower Suspense throttling heuristic to 300ms (#26803)
Now that the throttling mechanism applies more often, we've decided to lower this a tad to ensure it's not noticeable. The idea is it should be just large enough to prevent jank when lots of different parts of the UI load in rapid succession, but not large enough to make the UI feel sluggish. There's no perfect number, it's just a heuristic. DiffTrain build for commit f8de255.
1 parent c488cce commit 0d0ce18

File tree

13 files changed

+43
-43
lines changed

13 files changed

+43
-43
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<1559e1781d2b4f77a1b869cc6a27b095>>
10+
* @generated SignedSource<<ca59e5754dbc2396cdc2b7d218cedd13>>
1111
*/
1212

1313
'use strict';
@@ -20014,7 +20014,7 @@ var workInProgressRootRecoverableErrors = null; // The most recent time we eithe
2001420014
// TODO: Think of a better name for this variable?
2001520015

2001620016
var globalMostRecentFallbackTime = 0;
20017-
var FALLBACK_THROTTLE_MS = 500; // The absolute time for when we should start giving up on rendering
20017+
var FALLBACK_THROTTLE_MS = 300; // The absolute time for when we should start giving up on rendering
2001820018
// more and prefer CPU suspense heuristics instead.
2001920019

2002020020
var workInProgressRootRenderTargetTime = Infinity; // How long a render is supposed to take before we start following CPU
@@ -23930,7 +23930,7 @@ function createFiberRoot(
2393023930
return root;
2393123931
}
2393223932

23933-
var ReactVersion = "18.3.0-canary-4bfcd02b2-20230516";
23933+
var ReactVersion = "18.3.0-canary-f8de255e9-20230516";
2393423934

2393523935
// Might add PROFILE later.
2393623936

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<668f9e223a7ddfa69caac2f6094e95b5>>
10+
* @generated SignedSource<<bf297dad702ba511975b518d639aa865>>
1111
*/
1212

1313
"use strict";
@@ -6544,7 +6544,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
65446544
}
65456545
if (
65466546
(lanes & 125829120) === lanes &&
6547-
((didTimeout = globalMostRecentFallbackTime + 500 - now()),
6547+
((didTimeout = globalMostRecentFallbackTime + 300 - now()),
65486548
10 < didTimeout)
65496549
) {
65506550
markRootSuspended(root, lanes);
@@ -7457,7 +7457,7 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) {
74577457
(3 === workInProgressRootExitStatus &&
74587458
(workInProgressRootRenderLanes & 125829120) ===
74597459
workInProgressRootRenderLanes &&
7460-
500 > now() - globalMostRecentFallbackTime)
7460+
300 > now() - globalMostRecentFallbackTime)
74617461
? 0 === (executionContext & 2) && prepareFreshStack(root, 0)
74627462
: (workInProgressRootPingedLanes |= pingedLanes));
74637463
ensureRootIsScheduled(root);
@@ -8617,7 +8617,7 @@ var devToolsConfig$jscomp$inline_1036 = {
86178617
throw Error("TestRenderer does not support findFiberByHostInstance()");
86188618
},
86198619
bundleType: 0,
8620-
version: "18.3.0-canary-4bfcd02b2-20230516",
8620+
version: "18.3.0-canary-f8de255e9-20230516",
86218621
rendererPackageName: "react-test-renderer"
86228622
};
86238623
var internals$jscomp$inline_1235 = {
@@ -8648,7 +8648,7 @@ var internals$jscomp$inline_1235 = {
86488648
scheduleRoot: null,
86498649
setRefreshHandler: null,
86508650
getCurrentFiber: null,
8651-
reconcilerVersion: "18.3.0-canary-4bfcd02b2-20230516"
8651+
reconcilerVersion: "18.3.0-canary-f8de255e9-20230516"
86528652
};
86538653
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
86548654
var hook$jscomp$inline_1236 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

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

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

1313
"use strict";
@@ -6884,7 +6884,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
68846884
}
68856885
if (
68866886
(lanes & 125829120) === lanes &&
6887-
((didTimeout = globalMostRecentFallbackTime + 500 - now$1()),
6887+
((didTimeout = globalMostRecentFallbackTime + 300 - now$1()),
68886888
10 < didTimeout)
68896889
) {
68906890
markRootSuspended(root, lanes);
@@ -7865,7 +7865,7 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) {
78657865
(3 === workInProgressRootExitStatus &&
78667866
(workInProgressRootRenderLanes & 125829120) ===
78677867
workInProgressRootRenderLanes &&
7868-
500 > now$1() - globalMostRecentFallbackTime)
7868+
300 > now$1() - globalMostRecentFallbackTime)
78697869
? 0 === (executionContext & 2) && prepareFreshStack(root, 0)
78707870
: (workInProgressRootPingedLanes |= pingedLanes));
78717871
ensureRootIsScheduled(root);
@@ -9043,7 +9043,7 @@ var devToolsConfig$jscomp$inline_1078 = {
90439043
throw Error("TestRenderer does not support findFiberByHostInstance()");
90449044
},
90459045
bundleType: 0,
9046-
version: "18.3.0-canary-4bfcd02b2-20230516",
9046+
version: "18.3.0-canary-f8de255e9-20230516",
90479047
rendererPackageName: "react-test-renderer"
90489048
};
90499049
var internals$jscomp$inline_1276 = {
@@ -9074,7 +9074,7 @@ var internals$jscomp$inline_1276 = {
90749074
scheduleRoot: null,
90759075
setRefreshHandler: null,
90769076
getCurrentFiber: null,
9077-
reconcilerVersion: "18.3.0-canary-4bfcd02b2-20230516"
9077+
reconcilerVersion: "18.3.0-canary-f8de255e9-20230516"
90789078
};
90799079
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
90809080
var hook$jscomp$inline_1277 = __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
@@ -27,7 +27,7 @@ if (
2727
}
2828
"use strict";
2929

30-
var ReactVersion = "18.3.0-canary-4bfcd02b2-20230516";
30+
var ReactVersion = "18.3.0-canary-f8de255e9-20230516";
3131

3232
// ATTENTION
3333
// 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
@@ -642,4 +642,4 @@ exports.useSyncExternalStore = function (
642642
);
643643
};
644644
exports.useTransition = useTransition;
645-
exports.version = "18.3.0-canary-4bfcd02b2-20230516";
645+
exports.version = "18.3.0-canary-f8de255e9-20230516";

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
@@ -645,7 +645,7 @@ exports.useSyncExternalStore = function (
645645
);
646646
};
647647
exports.useTransition = useTransition;
648-
exports.version = "18.3.0-canary-4bfcd02b2-20230516";
648+
exports.version = "18.3.0-canary-f8de255e9-20230516";
649649

650650
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
651651
if (
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4bfcd02b2cebcb390f5aff0d7747c60a55012d5d
1+
f8de255e94540f9018d8196b3a34da500707c39b

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<dbadfcacc21c727a10f473c6628dc518>>
10+
* @generated SignedSource<<130672a53893af8813c0dcaa40c799e0>>
1111
*/
1212

1313
'use strict';
@@ -23119,7 +23119,7 @@ var workInProgressRootRecoverableErrors = null; // The most recent time we eithe
2311923119
// TODO: Think of a better name for this variable?
2312023120

2312123121
var globalMostRecentFallbackTime = 0;
23122-
var FALLBACK_THROTTLE_MS = 500; // The absolute time for when we should start giving up on rendering
23122+
var FALLBACK_THROTTLE_MS = 300; // The absolute time for when we should start giving up on rendering
2312323123
// more and prefer CPU suspense heuristics instead.
2312423124

2312523125
var workInProgressRootRenderTargetTime = Infinity; // How long a render is supposed to take before we start following CPU
@@ -27246,7 +27246,7 @@ function createFiberRoot(
2724627246
return root;
2724727247
}
2724827248

27249-
var ReactVersion = "18.3.0-canary-4e8bd686";
27249+
var ReactVersion = "18.3.0-canary-4ecba8f8";
2725027250

2725127251
function createPortal$1(
2725227252
children,

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<1129f51d0ce56db855259eecc041cfb0>>
10+
* @generated SignedSource<<d827ef8b6ab7cd5a32a962f196664c2a>>
1111
*/
1212

1313
"use strict";
@@ -7671,7 +7671,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
76717671
if (
76727672
(lanes & 125829120) === lanes &&
76737673
(alwaysThrottleRetries || 3 === exitStatus) &&
7674-
((exitStatus = globalMostRecentFallbackTime + 500 - now()),
7674+
((exitStatus = globalMostRecentFallbackTime + 300 - now()),
76757675
10 < exitStatus)
76767676
) {
76777677
markRootSuspended(root, lanes);
@@ -8530,7 +8530,7 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) {
85308530
(3 === workInProgressRootExitStatus &&
85318531
(workInProgressRootRenderLanes & 125829120) ===
85328532
workInProgressRootRenderLanes &&
8533-
500 > now() - globalMostRecentFallbackTime)
8533+
300 > now() - globalMostRecentFallbackTime)
85348534
? 0 === (executionContext & 2) && prepareFreshStack(root, 0)
85358535
: (workInProgressRootPingedLanes |= pingedLanes));
85368536
ensureRootIsScheduled(root);
@@ -9493,7 +9493,7 @@ var roots = new Map(),
94939493
devToolsConfig$jscomp$inline_1061 = {
94949494
findFiberByHostInstance: getInstanceFromNode,
94959495
bundleType: 0,
9496-
version: "18.3.0-canary-2c90a59e",
9496+
version: "18.3.0-canary-765a5f8c",
94979497
rendererPackageName: "react-native-renderer",
94989498
rendererConfig: {
94999499
getInspectorDataForViewTag: function () {
@@ -9535,7 +9535,7 @@ var internals$jscomp$inline_1299 = {
95359535
scheduleRoot: null,
95369536
setRefreshHandler: null,
95379537
getCurrentFiber: null,
9538-
reconcilerVersion: "18.3.0-canary-2c90a59e"
9538+
reconcilerVersion: "18.3.0-canary-765a5f8c"
95399539
};
95409540
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
95419541
var hook$jscomp$inline_1300 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<b2b07ccb72570d4ed30285fdbc7b6def>>
10+
* @generated SignedSource<<7478d1d49796ffd4357806e824bae4e5>>
1111
*/
1212

1313

@@ -8202,7 +8202,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
82028202
if (
82038203
(lanes & 125829120) === lanes &&
82048204
(alwaysThrottleRetries || 3 === exitStatus) &&
8205-
((exitStatus = globalMostRecentFallbackTime + 500 - now$1()),
8205+
((exitStatus = globalMostRecentFallbackTime + 300 - now$1()),
82068206
10 < exitStatus)
82078207
) {
82088208
markRootSuspended(root, lanes);
@@ -9206,7 +9206,7 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) {
92069206
(3 === workInProgressRootExitStatus &&
92079207
(workInProgressRootRenderLanes & 125829120) ===
92089208
workInProgressRootRenderLanes &&
9209-
500 > now$1() - globalMostRecentFallbackTime)
9209+
300 > now$1() - globalMostRecentFallbackTime)
92109210
? 0 === (executionContext & 2) && prepareFreshStack(root, 0)
92119211
: (workInProgressRootPingedLanes |= pingedLanes));
92129212
ensureRootIsScheduled(root);
@@ -10202,7 +10202,7 @@ var roots = new Map(),
1020210202
devToolsConfig$jscomp$inline_1139 = {
1020310203
findFiberByHostInstance: getInstanceFromNode,
1020410204
bundleType: 0,
10205-
version: "18.3.0-canary-a6509f52",
10205+
version: "18.3.0-canary-065b86a1",
1020610206
rendererPackageName: "react-native-renderer",
1020710207
rendererConfig: {
1020810208
getInspectorDataForViewTag: function () {
@@ -10257,7 +10257,7 @@ var roots = new Map(),
1025710257
scheduleRoot: null,
1025810258
setRefreshHandler: null,
1025910259
getCurrentFiber: null,
10260-
reconcilerVersion: "18.3.0-canary-a6509f52"
10260+
reconcilerVersion: "18.3.0-canary-065b86a1"
1026110261
});
1026210262
exports.createPortal = function (children, containerTag) {
1026310263
return createPortal$1(

0 commit comments

Comments
 (0)