Repository navigation
Stop the Diff view rescanning every file for each streamed file - #1556
Merged
Merged
Conversation
A diff with many files froze the window for minutes (#1545). Each file that streamed in rebuilt every file's header data, recounted the summary, republished the ready list and rescanned the loaded items by URI. Headers now look up their own entry, entries and items are indexed by resource, a batch of streamed files does its whole-list work once, and viewed scopes resync only for the files a session change names. The canvas groups lens ranges by file once. Agent-Session: f5bf6b6e-2f61-4a5d-a234-befeae23de4d Agent-Session: 33d99bfe-0d11-4a51-86b9-0a2f51551005
thesiti92
approved these changes
Nov 19, 2026
milanb17
enabled auto-merge (squash)
November 19, 2026 19:50
thesiti92
approved these changes
Nov 19, 2026
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.
What / why
Fixes #1545. A diff with many files froze the Desktop window for minutes. For each file that streamed in, the Diff view did work over the whole file list:
Cost grew quadratically with file count, and cubically in the last case. Reopening a finished comparison replayed all of it in one synchronous task.
Change
ReviewMultiDiffUIElementFactorytakes a per-resource lookup instead of a list of every entry.ReviewFilesDiffViewindexes entries and items by resource, with the comparison key cached per URI.ReviewFilesDiffView.batchdoes the header refresh, summary and ready-list work once per batch of streamed files.StructuralViewedStateresyncs only the files a session change names.Not changed: the work still runs on the UI thread, and there is no progress indicator, which the issue also asks for.
Result
Desktop, on a test commit touching 1,500 source files and 200 Git LFS pointer files, launched into the Diff tab with the Uncategorized lens selected:
Timings are from sampling the renderer's CPU every few seconds.
Checked
typecheck-clientfor the fork;tscforpackages/reviewandpackages/review/app.reviewStructuralViewed,reviewStructuralDiffSession,reviewDiffFind,reviewChangedFilesTree.review-lenses,diff-view-sidebar,review-diff-files-context.pnpm lint,pnpm format.