Skip to content

🤖 perf: speed up immersive review for large diffs#3175

Merged
ammario merged 1 commit into
mainfrom
perf/immersive-review-large-diffs
Apr 15, 2026
Merged

🤖 perf: speed up immersive review for large diffs#3175
ammario merged 1 commit into
mainfrom
perf/immersive-review-large-diffs

Conversation

@ammar-agent
Copy link
Copy Markdown
Collaborator

Summary

Immersive Review was doing repeated hot-path work during normal rerenders in large diff-heavy files. This change memoizes review-progress aggregation and active-file comment indicator mapping so keyboard navigation and cursor movement do less work in 3000+ LOC reviews.

Background

A user reported noticeable slowness in Immersive Review for large files with many diffs. The existing render path recalculated changed-line progress across all hunks and rebuilt minimap comment indices from the rendered overlay during routine immersive updates, which made the experience feel heavier than it needed to.

Implementation

  • memoize changed-line review progress across allHunks
  • memoize the active file's review list and minimap commentLineIndices
  • reuse stable empty collections to avoid avoidable prop churn into the immersive diff/minimap subtree
  • destructure isRead once so the memo dependencies stay narrow and lint-clean

Validation

  • make static-check
  • bun test src/browser/features/RightSidebar/CodeReview/ImmersiveReviewView.test.tsx

Risks

Low. The change is scoped to Immersive Review's derived render data and does not alter navigation or review semantics, but stale memo dependencies would show up as incorrect progress or missing comment markers.


Generated with mux • Model: openai:gpt-5.4 • Thinking: xhigh • Cost: $2.23

Memoize immersive review progress and active-file comment index calculations so
cursor movement in large diff-heavy files does not repeatedly rescan every hunk
or rebuild minimap line maps.

---

_Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` • Cost: `$2.23`_

<!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=2.23 -->
@ammar-agent
Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ammario
Copy link
Copy Markdown
Member

ammario commented Apr 15, 2026

Manually verified this works well

@ammario ammario merged commit 6a51b5a into main Apr 15, 2026
24 checks passed
@ammario ammario deleted the perf/immersive-review-large-diffs branch April 15, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants