GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Disable (unstable) scheduler sampling profiler for OSS builds (#20832) · react/react@af3d526

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/scheduler/src
    • SchedulerFeatureFlags.js
    • __tests__
      • SchedulerProfiling-test.js
    • forks
      • SchedulerDOM.js
      • SchedulerMock.js
      • SchedulerNoDOM.js
      • SchedulerPostTaskOnly.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/scheduler/src/SchedulerFeatureFlags.js‎

Copy file name to clipboardExpand all lines: packages/scheduler/src/SchedulerFeatureFlags.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
export const enableSchedulerDebugging = false;
1010
export const enableIsInputPending = false;
11-
export const enableProfiling = __PROFILE__;
11+
export const enableProfiling = false;
1212

1313
// TODO: enable to fix https://github.com/facebook/react/issues/20756.
1414
export const enableSetImmediate = __VARIANT__;
Collapse file

‎packages/scheduler/src/__tests__/SchedulerProfiling-test.js‎

Copy file name to clipboardExpand all lines: packages/scheduler/src/__tests__/SchedulerProfiling-test.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ function priorityLevelToString(priorityLevel) {
4444
}
4545

4646
describe('Scheduler', () => {
47-
if (!__PROFILE__) {
47+
const {enableProfiling} = require('scheduler/src/SchedulerFeatureFlags');
48+
if (!enableProfiling) {
4849
// The tests in this suite only apply when profiling is on
4950
it('profiling APIs are not available', () => {
5051
Scheduler = require('scheduler');
Collapse file

‎packages/scheduler/src/forks/SchedulerDOM.js‎

Copy file name to clipboardExpand all lines: packages/scheduler/src/forks/SchedulerDOM.js
+6-2Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,16 @@ function workLoop(hasTimeRemaining, initialTime) {
219219
currentTask.callback = null;
220220
currentPriorityLevel = currentTask.priorityLevel;
221221
const didUserCallbackTimeout = currentTask.expirationTime <= currentTime;
222-
markTaskRun(currentTask, currentTime);
222+
if (enableProfiling) {
223+
markTaskRun(currentTask, currentTime);
224+
}
223225
const continuationCallback = callback(didUserCallbackTimeout);
224226
currentTime = getCurrentTime();
225227
if (typeof continuationCallback === 'function') {
226228
currentTask.callback = continuationCallback;
227-
markTaskYield(currentTask, currentTime);
229+
if (enableProfiling) {
230+
markTaskYield(currentTask, currentTime);
231+
}
228232
} else {
229233
if (enableProfiling) {
230234
markTaskCompleted(currentTask, currentTime);
Collapse file

‎packages/scheduler/src/forks/SchedulerMock.js‎

Copy file name to clipboardExpand all lines: packages/scheduler/src/forks/SchedulerMock.js
+6-2Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,16 @@ function workLoop(hasTimeRemaining, initialTime) {
183183
currentTask.callback = null;
184184
currentPriorityLevel = currentTask.priorityLevel;
185185
const didUserCallbackTimeout = currentTask.expirationTime <= currentTime;
186-
markTaskRun(currentTask, currentTime);
186+
if (enableProfiling) {
187+
markTaskRun(currentTask, currentTime);
188+
}
187189
const continuationCallback = callback(didUserCallbackTimeout);
188190
currentTime = getCurrentTime();
189191
if (typeof continuationCallback === 'function') {
190192
currentTask.callback = continuationCallback;
191-
markTaskYield(currentTask, currentTime);
193+
if (enableProfiling) {
194+
markTaskYield(currentTask, currentTime);
195+
}
192196
} else {
193197
if (enableProfiling) {
194198
markTaskCompleted(currentTask, currentTime);
Collapse file

‎packages/scheduler/src/forks/SchedulerNoDOM.js‎

Copy file name to clipboardExpand all lines: packages/scheduler/src/forks/SchedulerNoDOM.js
+6-2Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,16 @@ function workLoop(hasTimeRemaining, initialTime) {
185185
currentTask.callback = null;
186186
currentPriorityLevel = currentTask.priorityLevel;
187187
const didUserCallbackTimeout = currentTask.expirationTime <= currentTime;
188-
markTaskRun(currentTask, currentTime);
188+
if (enableProfiling) {
189+
markTaskRun(currentTask, currentTime);
190+
}
189191
const continuationCallback = callback(didUserCallbackTimeout);
190192
currentTime = getCurrentTime();
191193
if (typeof continuationCallback === 'function') {
192194
currentTask.callback = continuationCallback;
193-
markTaskYield(currentTask, currentTime);
195+
if (enableProfiling) {
196+
markTaskYield(currentTask, currentTime);
197+
}
194198
} else {
195199
if (enableProfiling) {
196200
markTaskCompleted(currentTask, currentTime);
Collapse file

‎packages/scheduler/src/forks/SchedulerPostTaskOnly.js‎

Copy file name to clipboardExpand all lines: packages/scheduler/src/forks/SchedulerPostTaskOnly.js
+6-2Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,16 @@ function workLoop(hasTimeRemaining, initialTime) {
210210
currentTask.callback = null;
211211
currentPriorityLevel = currentTask.priorityLevel;
212212
const didUserCallbackTimeout = currentTask.expirationTime <= currentTime;
213-
markTaskRun(currentTask, currentTime);
213+
if (enableProfiling) {
214+
markTaskRun(currentTask, currentTime);
215+
}
214216
const continuationCallback = callback(didUserCallbackTimeout);
215217
currentTime = getCurrentTime();
216218
if (typeof continuationCallback === 'function') {
217219
currentTask.callback = continuationCallback;
218-
markTaskYield(currentTask, currentTime);
220+
if (enableProfiling) {
221+
markTaskYield(currentTask, currentTime);
222+
}
219223
} else {
220224
if (enableProfiling) {
221225
markTaskCompleted(currentTask, currentTime);

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.