diff --git a/packages/scheduler/src/Scheduler.js b/packages/scheduler/src/Scheduler.js index 9162da0a0875c..efcc01fa6805a 100644 --- a/packages/scheduler/src/Scheduler.js +++ b/packages/scheduler/src/Scheduler.js @@ -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); diff --git a/packages/scheduler/src/SchedulerFeatureFlags.js b/packages/scheduler/src/SchedulerFeatureFlags.js index 848c299dd6df4..9b9deeb63ec1c 100644 --- a/packages/scheduler/src/SchedulerFeatureFlags.js +++ b/packages/scheduler/src/SchedulerFeatureFlags.js @@ -8,4 +8,4 @@ export const enableSchedulerDebugging = false; export const enableIsInputPending = false; -export const enableProfiling = __PROFILE__; +export const enableProfiling = false; diff --git a/packages/scheduler/src/__tests__/SchedulerProfiling-test.js b/packages/scheduler/src/__tests__/SchedulerProfiling-test.js index cf9f9c5ea8cd8..b7828b14487fd 100644 --- a/packages/scheduler/src/__tests__/SchedulerProfiling-test.js +++ b/packages/scheduler/src/__tests__/SchedulerProfiling-test.js @@ -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');