mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Disable (unstable) scheduler sampling profiler for OSS builds (#20832)
* Disabled Scheduler sampling profiler for OSS builds * Added missing conditional feature flag around profiling calls
This commit is contained in:
committed by
Dan Abramov
parent
8cc6ff2488
commit
b2bbee7ba3
@@ -181,12 +181,16 @@ function workLoop(hasTimeRemaining, initialTime) {
|
||||
currentTask.callback = null;
|
||||
currentPriorityLevel = currentTask.priorityLevel;
|
||||
const didUserCallbackTimeout = currentTask.expirationTime <= currentTime;
|
||||
markTaskRun(currentTask, currentTime);
|
||||
if (enableProfiling) {
|
||||
markTaskRun(currentTask, currentTime);
|
||||
}
|
||||
const continuationCallback = callback(didUserCallbackTimeout);
|
||||
currentTime = getCurrentTime();
|
||||
if (typeof continuationCallback === 'function') {
|
||||
currentTask.callback = continuationCallback;
|
||||
markTaskYield(currentTask, currentTime);
|
||||
if (enableProfiling) {
|
||||
markTaskYield(currentTask, currentTime);
|
||||
}
|
||||
} else {
|
||||
if (enableProfiling) {
|
||||
markTaskCompleted(currentTask, currentTime);
|
||||
|
||||
@@ -8,4 +8,4 @@
|
||||
|
||||
export const enableSchedulerDebugging = false;
|
||||
export const enableIsInputPending = false;
|
||||
export const enableProfiling = __PROFILE__;
|
||||
export const enableProfiling = false;
|
||||
|
||||
@@ -44,7 +44,8 @@ function priorityLevelToString(priorityLevel) {
|
||||
}
|
||||
|
||||
describe('Scheduler', () => {
|
||||
if (!__PROFILE__) {
|
||||
const {enableProfiling} = require('scheduler/src/SchedulerFeatureFlags');
|
||||
if (!enableProfiling) {
|
||||
// The tests in this suite only apply when profiling is on
|
||||
it('profiling APIs are not available', () => {
|
||||
Scheduler = require('scheduler');
|
||||
|
||||
Reference in New Issue
Block a user