Skip to content

Commit c27df86

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 5b8b9c7 commit c27df86

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
@@ -209,12 +209,19 @@ export function logCommitPhase(startTime: number, endTime: number): void {
209209
}
210210
}
211211

212-
export function logPaintYieldPhase(startTime: number, endTime: number): void {
212+
export function logPaintYieldPhase(
213+
startTime: number,
214+
endTime: number,
215+
delayedUntilPaint: boolean,
216+
): void {
213217
if (supportsUserTiming) {
214218
reusableComponentDevToolDetails.color = 'secondary-light';
215219
reusableComponentOptions.start = startTime;
216220
reusableComponentOptions.end = endTime;
217-
performance.measure('Waiting for Paint', reusableComponentOptions);
221+
performance.measure(
222+
delayedUntilPaint ? 'Waiting for Paint' : '',
223+
reusableComponentOptions,
224+
);
218225
}
219226
}
220227

packages/react-reconciler/src/ReactFiberWorkLoop.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -3545,9 +3545,11 @@ function flushPassiveEffectsImpl(wasDelayedCommit: void | boolean) {
35453545
let passiveEffectStartTime = 0;
35463546
if (enableProfilerTimer && enableComponentPerformanceTrack) {
35473547
passiveEffectStartTime = now();
3548-
if (wasDelayedCommit) {
3549-
logPaintYieldPhase(commitEndTime, passiveEffectStartTime);
3550-
}
3548+
logPaintYieldPhase(
3549+
commitEndTime,
3550+
passiveEffectStartTime,
3551+
!!wasDelayedCommit,
3552+
);
35513553
}
35523554

35533555
if (enableSchedulingProfiler) {

0 commit comments

Comments
 (0)