Skip to content

Commit

Permalink
Revert "Performance tracks are sorted by start time" hack (#31518)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sebmarkbage authored Nov 12, 2024
1 parent 2ec26bc commit d9b3841
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions packages/react-reconciler/src/ReactProfilerTimer.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,8 @@ export function popComponentEffectStart(prevEffectStart: number): void {
if (!enableProfilerTimer || !enableProfilerCommitHooks) {
return;
}
if (prevEffectStart < 0) {
// If the parent component didn't have a start time, we use the start
// of the child as the parent's start time. We subtrack a minimal amount of
// time to ensure that the parent's start time is before the child to ensure
// that the performance tracks line up in the right order.
componentEffectStartTime -= 0.001;
} else {
// If the parent component didn't have a start time, we let this current time persist.
if (prevEffectStart >= 0) {
// Otherwise, we restore the previous parent's start time.
componentEffectStartTime = prevEffectStart;
}
Expand Down

0 comments on commit d9b3841

Please sign in to comment.