Repository navigation
fix(app): break ResizeObserver feedback loop in composer docks - #50104
Closed
Lightningxxl wants to merge 1 commit into
Closed
Lightningxxl wants to merge 1 commit into
Lightningxxl wants to merge 1 commit into
Conversation
Defer composer-dock ResizeObserver callbacks to rAF and ignore sub-pixel size deltas so the measure->write-max-height cycle can no longer re-trigger observation within the same frame. Removes the self-sustaining idle layout thrash (renderer ~76% sustained CPU, ResizeObserver error storm) without changing rendered output. Refs anomalyco#38296 anomalyco#43355 anomalyco#33712
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Member
|
This branch has been upgraded to V2. We're no longer taking PRs for V1. If you think this is still relevant, please port it over and open it for V2. — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊 |
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.
Issue for this PR
Closes #38296
Refs #43355, #33712. The streaming-side cost (#49552) is a separate concern and is intentionally not in this PR.
Type of change
What does this PR do?
The Desktop renderer burns ~76% CPU at idle because composer-dock ResizeObserver callbacks measure height and synchronously write the parent
max-height/marginin the same frame (useSpring-driven), re-triggering observation every frame. It's a self-sustaining layout thrash that floods renderer.log with "ResizeObserver loop completed" errors. On a real 2d5h session: renderer 40h CPU / 53h uptime, 93% of the 1416 RO errors landed in minutes with zero streaming activity, and the storm returns 26s after a relaunch.Fix: defer the four composer-dock RO callbacks (region controller, todo dock, question dock, and the session.tsx promptDock amplifier) to rAF and ignore <1px deltas, so a measure->write cycle can't re-trigger observation within the same frame. Rendered output is unchanged (sub-pixel deltas aren't visible; rAF matches render timing) — only the redundant same-frame layout work is removed. No visual or product change, no animations touched.
How did you verify your code works?
dev;tsgo -b(packages/app typecheck) passes.Screenshots / recordings
N/A — perf-only change, no visual difference intended.
Checklist