@samitouri / QOS-React-1 / commits / d9b3841ca6

Revert "Performance tracks are sorted by start time" hack (#31518)

This reverts commit d3bf32a95806b6d583ef041b8d83781cd686cfd8 which was part of #30983 When you have very deep trees this trick can cause the top levels to skew way too much from the real numbers. Creating unbalanced trees. The bug should have been fixed in Chrome Canary now so that entries added later are sorted to go first which should've addressed this issue.

Sebastian Markbåge committed Nov 12, 2024 at 12:46 UTC d9b3841ca64f292e3450edcd0a87eca05ac4c5f9
1 file changed +2 -7
packages/react-reconciler/src/ReactProfilerTimer.js
+2 -7
@@ -193,13 +193,8 @@ export function popComponentEffectStart(prevEffectStart: number): void {
193 if (!enableProfilerTimer || !enableProfilerCommitHooks) {
194 return;
195 }
196 - if (prevEffectStart < 0) {
197 - // If the parent component didn't have a start time, we use the start
198 - // of the child as the parent's start time. We subtrack a minimal amount of
199 - // time to ensure that the parent's start time is before the child to ensure
200 - // that the performance tracks line up in the right order.
201 - componentEffectStartTime -= 0.001;
202 - } else {
196 + // If the parent component didn't have a start time, we let this current time persist.
197 + if (prevEffectStart >= 0) {
198 // Otherwise, we restore the previous parent's start time.
199 componentEffectStartTime = prevEffectStart;
200 }