Skip to content

Commit c98b3ea

Browse files
committed
Always log the delay between commit and passive effects
Even if it's forced. This ensures the phases are connected. We use an empty string for this phase.
1 parent 29b5c70 commit c98b3ea

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

packages/react-reconciler/src/ReactFiberPerformanceTrack.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,19 @@ export function logCommitPhase(startTime: number, endTime: number): void {
221221
}
222222
}
223223

224-
export function logPaintYieldPhase(startTime: number, endTime: number): void {
224+
export function logPaintYieldPhase(
225+
startTime: number,
226+
endTime: number,
227+
delayedUntilPaint: boolean,
228+
): void {
225229
if (supportsUserTiming) {
226230
reusableLaneDevToolDetails.color = 'secondary-light';
227231
reusableLaneOptions.start = startTime;
228232
reusableLaneOptions.end = endTime;
229-
performance.measure('Waiting for Paint', reusableLaneOptions);
233+
performance.measure(
234+
delayedUntilPaint ? 'Waiting for Paint' : '',
235+
reusableLaneOptions,
236+
);
230237
}
231238
}
232239

packages/react-reconciler/src/ReactFiberWorkLoop.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -3550,9 +3550,11 @@ function flushPassiveEffectsImpl(wasDelayedCommit: void | boolean) {
35503550
let passiveEffectStartTime = 0;
35513551
if (enableProfilerTimer && enableComponentPerformanceTrack) {
35523552
passiveEffectStartTime = now();
3553-
if (wasDelayedCommit) {
3554-
logPaintYieldPhase(commitEndTime, passiveEffectStartTime);
3555-
}
3553+
logPaintYieldPhase(
3554+
commitEndTime,
3555+
passiveEffectStartTime,
3556+
!!wasDelayedCommit,
3557+
);
35563558
}
35573559

35583560
if (enableSchedulingProfiler) {

0 commit comments

Comments
 (0)