[DevTools] Don't capture durations for disconnected subtrees when profiling#484
Closed
everettbu wants to merge 1 commit into
Closed
[DevTools] Don't capture durations for disconnected subtrees when profiling#484everettbu wants to merge 1 commit into
everettbu wants to merge 1 commit into
Conversation
Greptile OverviewGreptile SummaryThis change prevents DevTools’ backend renderer from recording profiling duration ops while traversing a disconnected subtree. That avoids emitting Confidence Score: 5/5
Important Files Changed
|
Author
|
Upstream PR was closed or merged. Code is synced via branch mirror. |
everettbu
deleted the
devtools/dont-capture-durations-for-disconnected-subtrees
branch
February 9, 2026 22:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mirror of facebook/react#35718
Original author: hoxyq
After react/react#34089, when updating (possibly, mounting) inside disconnected subtree, we don't record this as an operation. This only happens during reconnect. The issue is that
recordProfilingDurations()can be called, which diffs tree base duration and reports it to the Frontend:https://github.com/facebook/react/blob/65db1000b944c8a07b5947c06b38eb8364dce4f2/packages/react-devtools-shared/src/backend/fiber/renderer.js#L4506-L4521
This operation can be recorded before the "Add" operation, and it will not be resolved properly on the Frontend side.
Before the fix: