Speed up indexing for large workspaces - #5047
Merged
Widthdom merged 14 commits intoAug 9, 2026
Merged
Conversation
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
Why
Large workspace updates were spending substantial time maintaining secondary reference indexes during row-by-row writes, rebuilding facts that were already available, scanning regexes that could not match, and serially extracting authoritative C# updates. Normalization-derived facts were also recomputed separately by chunking and validation.
These changes move expensive work out of the per-row hot path, reuse already-materialized facts, parallelize independent extraction, and add conservative early exits while preserving indexing and reference-graph contracts.
Impact
On the same large-workspace update scenario, the observed duration moved from 302.547 seconds to a three-run median of 219.339 seconds (about 27.5% faster). The final HEAD run completed in 223.424 seconds for 1,130 updated files with a peak working set of about 526 MiB.
The exact file count changed slightly between runs, so these figures are indicative rather than a strict microbenchmark comparison.
Validation
ff9397594: 11,141 passed, 7 skipped, 0 failed.FileIndexerTestspassed on net8.0 and net9.0 (633 each).Collaborator checklist