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 — Remove "Waiting for async callback" User Timing measurement (#16379) · react/react@1fd3906

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/react-reconciler/src
    • ReactFiber.js
    • ReactFiberWorkLoop.js
    • __tests__
      • ReactIncrementalPerf-test.internal.js
      • __snapshots__
        • ReactIncrementalPerf-test.internal.js.snap
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/react-reconciler/src/ReactFiber.js‎

Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiber.js
+9-7Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import warningWithoutStack from 'shared/warningWithoutStack';
3131
import {
3232
enableProfilerTimer,
3333
enableFundamentalAPI,
34+
enableUserTimingAPI,
3435
} from 'shared/ReactFeatureFlags';
3536
import {NoEffect, Placement} from 'shared/ReactSideEffectTags';
3637
import {ConcurrentRoot, BatchedRoot} from 'shared/ReactRootTags';
@@ -245,11 +246,7 @@ export type Fiber = {|
245246
_debugHookTypes?: Array<HookType> | null,
246247
|};
247248

248-
let debugCounter;
249-
250-
if (__DEV__) {
251-
debugCounter = 1;
252-
}
249+
let debugCounter = 1;
253250

254251
function FiberNode(
255252
tag: WorkTag,
@@ -319,11 +316,16 @@ function FiberNode(
319316
this.treeBaseDuration = 0;
320317
}
321318

322-
if (__DEV__) {
319+
// This is normally DEV-only except www when it adds listeners.
320+
// TODO: remove the User Timing integration in favor of Root Events.
321+
if (enableUserTimingAPI) {
323322
this._debugID = debugCounter++;
323+
this._debugIsCurrentlyTiming = false;
324+
}
325+
326+
if (__DEV__) {
324327
this._debugSource = null;
325328
this._debugOwner = null;
326-
this._debugIsCurrentlyTiming = false;
327329
this._debugNeedsRemount = false;
328330
this._debugHookTypes = null;
329331
if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') {
Collapse file

‎packages/react-reconciler/src/ReactFiberWorkLoop.js‎

Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberWorkLoop.js
-20Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,6 @@ import {
152152
import {
153153
recordEffect,
154154
recordScheduleUpdate,
155-
startRequestCallbackTimer,
156-
stopRequestCallbackTimer,
157155
startWorkTimer,
158156
stopWorkTimer,
159157
stopFailedWorkTimer,
@@ -546,16 +544,6 @@ function scheduleCallbackForRoot(
546544
),
547545
options,
548546
);
549-
if (
550-
enableUserTimingAPI &&
551-
expirationTime !== Sync &&
552-
(executionContext & (RenderContext | CommitContext)) === NoContext
553-
) {
554-
// Scheduled an async callback, and we're not already working. Add an
555-
// entry to the flamegraph that shows we're waiting for a callback
556-
// to fire.
557-
startRequestCallbackTimer();
558-
}
559547
}
560548
}
561549

@@ -816,11 +804,6 @@ function renderRoot(
816804
'Should not already be working.',
817805
);
818806

819-
if (enableUserTimingAPI && expirationTime !== Sync) {
820-
const didExpire = isSync;
821-
stopRequestCallbackTimer(didExpire);
822-
}
823-
824807
if (root.firstPendingTime < expirationTime) {
825808
// If there's no work left at this expiration time, exit immediately. This
826809
// happens when multiple callbacks are scheduled for a single root, but an
@@ -964,9 +947,6 @@ function renderRoot(
964947
if (workInProgress !== null) {
965948
// There's still work left over. Return a continuation.
966949
stopInterruptedWorkLoopTimer();
967-
if (expirationTime !== Sync) {
968-
startRequestCallbackTimer();
969-
}
970950
return renderRoot.bind(null, root, expirationTime);
971951
}
972952
}
Collapse file

‎packages/react-reconciler/src/__tests__/ReactIncrementalPerf-test.internal.js‎

Copy file name to clipboardExpand all lines: packages/react-reconciler/src/__tests__/ReactIncrementalPerf-test.internal.js
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,15 @@ describe('ReactDebugFiberPerf', () => {
8989
// We don't use the overload with three arguments.
9090
measure(label, markName) {
9191
if (markName !== activeMeasure.markName) {
92+
// Fail the test.
93+
console.error(
94+
'Unexpected measure() call: "%s". Active mark is "%s".',
95+
markName,
96+
activeMeasure.markName,
97+
);
98+
// This exception will be caught and ignored
99+
// because in the real implementation, we don't want
100+
// to spam the console due to a React bug.
92101
throw new Error('Unexpected measure() call.');
93102
}
94103
// Step one level up

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.