@samitouri / QOS-React-2 / commits / 76bbad3e34

Add maxYieldMs feature flag in Scheduler (#22165)

Ricky committed Aug 24, 2021 at 13:03 UTC 76bbad3e34bc3403ddbe59e12845e8643dbb8d9f
4 files changed +5 -1
packages/scheduler/src/SchedulerFeatureFlags.js
+1
@@ -12,3 +12,4 @@ export const enableProfiling = false;
12 export const enableIsInputPendingContinuous = false;
13 export const frameYieldMs = 5;
14 export const continuousYieldMs = 50;
15 +export const maxYieldMs = 300;
packages/scheduler/src/forks/Scheduler.js
+2 -1
@@ -15,6 +15,7 @@ import {
15 enableIsInputPendingContinuous,
16 frameYieldMs,
17 continuousYieldMs,
18 + maxYieldMs,
19 } from '../SchedulerFeatureFlags';
20
21 import {push, pop, peek} from '../SchedulerMinHeap';
@@ -431,7 +432,7 @@ let taskTimeoutID = -1;
432 // need to be frame aligned; for those that do, use requestAnimationFrame.
433 let frameInterval = frameYieldMs;
434 const continuousInputInterval = continuousYieldMs;
434 -const maxInterval = 300;
435 +const maxInterval = maxYieldMs;
436 let startTime = -1;
437
438 let needsPaint = false;
packages/scheduler/src/forks/SchedulerFeatureFlags.www-dynamic.js
+1
@@ -18,3 +18,4 @@ export const enableProfiling = __VARIANT__;
18 export const enableIsInputPendingContinuous = __VARIANT__;
19 export const frameYieldMs = 5;
20 export const continuousYieldMs = 50;
21 +export const maxYieldMs = 300;
packages/scheduler/src/forks/SchedulerFeatureFlags.www.js
+1
@@ -16,6 +16,7 @@ export const {
16 enableIsInputPendingContinuous,
17 frameYieldMs,
18 continuousYieldMs,
19 + maxYieldMs,
20 } = dynamicFeatureFlags;
21
22 export const enableProfiling = __PROFILE__ && enableProfilingFeatureFlag;