GeezerVison is showing github.com — Disable (unstable) scheduler sampling profiler for OSS builds (#20832) · react/react@af3d526
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: packages/scheduler/src/SchedulerFeatureFlags.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 8 | 8 |
| 9 | 9 | export const enableSchedulerDebugging = false; | 10 | 10 | export const enableIsInputPending = false; | 11 | | -export const enableProfiling = __PROFILE__; | | 11 | +export const enableProfiling = false; | 12 | 12 |
| 13 | 13 | // TODO: enable to fix https://github.com/facebook/react/issues/20756. | 14 | 14 | export const enableSetImmediate = __VARIANT__; |
Collapse file Copy file name to clipboardExpand all lines: packages/scheduler/src/__tests__/SchedulerProfiling-test.js +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -44,7 +44,8 @@ function priorityLevelToString(priorityLevel) { | 44 | 44 | } | 45 | 45 |
| 46 | 46 | describe('Scheduler', () => { | 47 | | - if (!__PROFILE__) { | | 47 | + const {enableProfiling} = require('scheduler/src/SchedulerFeatureFlags'); | | 48 | + if (!enableProfiling) { | 48 | 49 | // The tests in this suite only apply when profiling is on | 49 | 50 | it('profiling APIs are not available', () => { | 50 | 51 | Scheduler = require('scheduler'); | |
Collapse file Copy file name to clipboardExpand all lines: packages/scheduler/src/forks/SchedulerDOM.js +6-2Lines changed: 6 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -219,12 +219,16 @@ function workLoop(hasTimeRemaining, initialTime) { | 219 | 219 | currentTask.callback = null; | 220 | 220 | currentPriorityLevel = currentTask.priorityLevel; | 221 | 221 | const didUserCallbackTimeout = currentTask.expirationTime <= currentTime; | 222 | | - markTaskRun(currentTask, currentTime); | | 222 | + if (enableProfiling) { | | 223 | + markTaskRun(currentTask, currentTime); | | 224 | + } | 223 | 225 | const continuationCallback = callback(didUserCallbackTimeout); | 224 | 226 | currentTime = getCurrentTime(); | 225 | 227 | if (typeof continuationCallback === 'function') { | 226 | 228 | currentTask.callback = continuationCallback; | 227 | | - markTaskYield(currentTask, currentTime); | | 229 | + if (enableProfiling) { | | 230 | + markTaskYield(currentTask, currentTime); | | 231 | + } | 228 | 232 | } else { | 229 | 233 | if (enableProfiling) { | 230 | 234 | markTaskCompleted(currentTask, currentTime); | |
Collapse file Copy file name to clipboardExpand all lines: packages/scheduler/src/forks/SchedulerMock.js +6-2Lines changed: 6 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -183,12 +183,16 @@ function workLoop(hasTimeRemaining, initialTime) { | 183 | 183 | currentTask.callback = null; | 184 | 184 | currentPriorityLevel = currentTask.priorityLevel; | 185 | 185 | const didUserCallbackTimeout = currentTask.expirationTime <= currentTime; | 186 | | - markTaskRun(currentTask, currentTime); | | 186 | + if (enableProfiling) { | | 187 | + markTaskRun(currentTask, currentTime); | | 188 | + } | 187 | 189 | const continuationCallback = callback(didUserCallbackTimeout); | 188 | 190 | currentTime = getCurrentTime(); | 189 | 191 | if (typeof continuationCallback === 'function') { | 190 | 192 | currentTask.callback = continuationCallback; | 191 | | - markTaskYield(currentTask, currentTime); | | 193 | + if (enableProfiling) { | | 194 | + markTaskYield(currentTask, currentTime); | | 195 | + } | 192 | 196 | } else { | 193 | 197 | if (enableProfiling) { | 194 | 198 | markTaskCompleted(currentTask, currentTime); | |
Collapse file Copy file name to clipboardExpand all lines: packages/scheduler/src/forks/SchedulerNoDOM.js +6-2Lines changed: 6 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -185,12 +185,16 @@ function workLoop(hasTimeRemaining, initialTime) { | 185 | 185 | currentTask.callback = null; | 186 | 186 | currentPriorityLevel = currentTask.priorityLevel; | 187 | 187 | const didUserCallbackTimeout = currentTask.expirationTime <= currentTime; | 188 | | - markTaskRun(currentTask, currentTime); | | 188 | + if (enableProfiling) { | | 189 | + markTaskRun(currentTask, currentTime); | | 190 | + } | 189 | 191 | const continuationCallback = callback(didUserCallbackTimeout); | 190 | 192 | currentTime = getCurrentTime(); | 191 | 193 | if (typeof continuationCallback === 'function') { | 192 | 194 | currentTask.callback = continuationCallback; | 193 | | - markTaskYield(currentTask, currentTime); | | 195 | + if (enableProfiling) { | | 196 | + markTaskYield(currentTask, currentTime); | | 197 | + } | 194 | 198 | } else { | 195 | 199 | if (enableProfiling) { | 196 | 200 | markTaskCompleted(currentTask, currentTime); | |
Collapse file Copy file name to clipboardExpand all lines: packages/scheduler/src/forks/SchedulerPostTaskOnly.js +6-2Lines changed: 6 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -210,12 +210,16 @@ function workLoop(hasTimeRemaining, initialTime) { | 210 | 210 | currentTask.callback = null; | 211 | 211 | currentPriorityLevel = currentTask.priorityLevel; | 212 | 212 | const didUserCallbackTimeout = currentTask.expirationTime <= currentTime; | 213 | | - markTaskRun(currentTask, currentTime); | | 213 | + if (enableProfiling) { | | 214 | + markTaskRun(currentTask, currentTime); | | 215 | + } | 214 | 216 | const continuationCallback = callback(didUserCallbackTimeout); | 215 | 217 | currentTime = getCurrentTime(); | 216 | 218 | if (typeof continuationCallback === 'function') { | 217 | 219 | currentTask.callback = continuationCallback; | 218 | | - markTaskYield(currentTask, currentTime); | | 220 | + if (enableProfiling) { | | 221 | + markTaskYield(currentTask, currentTime); | | 222 | + } | 219 | 223 | } else { | 220 | 224 | if (enableProfiling) { | 221 | 225 | markTaskCompleted(currentTask, currentTime); | |
|