🤖 perf: WIP immersive review typing performance loop#2670
Draft
ammar-agent wants to merge 7 commits intomainfrom
Draft
🤖 perf: WIP immersive review typing performance loop#2670ammar-agent wants to merge 7 commits intomainfrom
ammar-agent wants to merge 7 commits intomainfrom
Conversation
Switch the immersive review composer textarea to an uncontrolled input so each keypress no longer triggers React state updates across the diff surface. Also move autosize work behind requestAnimationFrame scheduling to avoid synchronous per-key layout churn while keeping prefill + submit behavior unchanged. --- _Generated with `mux` • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$0.00`_ <!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=0.00 -->
Reduce line-range selection lag in immersive review by coalescing drag selection updates to one per animation frame and avoiding redundant state writes when selection indices are unchanged. This keeps hunk/cursor sync behavior intact while cutting expensive parent/child re-render churn during rapid mouse drag selection. --- _Generated with `mux` • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$0.00`_ <!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=0.00 -->
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.
Summary
WIP: iterative immersive-review typing performance work for very large diffs while preserving immersive layout stability.
Background
Profiling identified typing latency in inline review composer as primarily layout-bound on ~2,000-line immersive diffs.
Implementation
scrollHeightreads with newline-count-based row syncing (2..8 rows), keeping the composer uncontrolled.>= 500lines)content-visibility+ intrinsic-size hint on those offscreen rowsValidation
make static-checkmake typecheckbun test src/browser/components/shared/DiffRenderer.test.tsxbun test src/browser/components/shared/SelectableDiffRenderer.dragSelect.test.tsximmersive-large-diff-type-2000-post-fix-2026-02-26T16-57-44-801Zimmersive-large-diff-type-2000-post-fix-4-2026-02-26T19-04-18-532ZLatest Perf Delta (typing 300 chars, 2,000-line diff)
13,027ms -> 3,323ms(-74.5%)13.15s -> 3.37s(-74.4%)9.25s -> 0.93s(-90.0%)301), but each layout is much cheaper.Risks
content-visibilitybehavior is browser-sensitive. Scope is intentionally narrow (composer-active + large diff only) to reduce UX blast radius.WIP / Next Step
Generated with
mux• Model:openai:gpt-5.3-codex• Thinking:xhigh• Cost:$1.82