Skip to content

Commit d9b3841

Browse files
authored
Revert "Performance tracks are sorted by start time" hack (#31518)
This reverts commit d3bf32a 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.
1 parent 2ec26bc commit d9b3841

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

packages/react-reconciler/src/ReactProfilerTimer.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,8 @@ export function popComponentEffectStart(prevEffectStart: number): void {
193193
if (!enableProfilerTimer || !enableProfilerCommitHooks) {
194194
return;
195195
}
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) {
203198
// Otherwise, we restore the previous parent's start time.
204199
componentEffectStartTime = prevEffectStart;
205200
}

0 commit comments

Comments
 (0)