Skip to content

Commit

Permalink
Use completedRenderEndTime as the start of the commit phase if it's a…
Browse files Browse the repository at this point in the history
…n immediate commit (#31527)

We don't log a phase like "Throttled" or "Suspended" for this case so it
can leave a tiny gap otherwise.

This ensures it connects without a seam.

<img width="1059" alt="Screenshot 2024-11-12 at 9 34 17 PM"
src="https://github.com/user-attachments/assets/7ed4a3c7-b508-4fc1-b956-44c4e31faa4d">
  • Loading branch information
sebmarkbage authored Nov 14, 2024
1 parent 8657869 commit 3644f0b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/react-reconciler/src/ReactFiberWorkLoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -3250,7 +3250,12 @@ function commitRootImpl(

if (enableProfilerTimer && enableComponentPerformanceTrack) {
recordCommitEndTime();
logCommitPhase(commitStartTime, commitEndTime);
logCommitPhase(
suspendedCommitReason === IMMEDIATE_COMMIT
? completedRenderEndTime
: commitStartTime,
commitEndTime,
);
}

const rootDidHavePassiveEffects = rootDoesHavePassiveEffects;
Expand Down

0 comments on commit 3644f0b

Please sign in to comment.