@samitouri / QOS-React-2 / commits / 3644f0bd21

Use completedRenderEndTime as the start of the commit phase if it's an 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">

Sebastian Markbåge committed Nov 14, 2024 at 13:05 UTC 3644f0bd214b7c08a522cc9212dfca902777bf8c
1 file changed +6 -1
packages/react-reconciler/src/ReactFiberWorkLoop.js
+6 -1
@@ -3250,7 +3250,12 @@ function commitRootImpl(
3250
3251 if (enableProfilerTimer && enableComponentPerformanceTrack) {
3252 recordCommitEndTime();
3253 - logCommitPhase(commitStartTime, commitEndTime);
3253 + logCommitPhase(
3254 + suspendedCommitReason === IMMEDIATE_COMMIT
3255 + ? completedRenderEndTime
3256 + : commitStartTime,
3257 + commitEndTime,
3258 + );
3259 }
3260
3261 const rootDidHavePassiveEffects = rootDoesHavePassiveEffects;