Perf: reduce initial full-index lookup and C# extraction costs - #5342
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
Initial full indexing spends avoidable work sorting reference-source candidates and repeatedly scanning and allocating C# declaration text. These changes reduce that work while preserving existing extraction records and recovering previously missed constructors.
Database layout, transaction boundaries, cancellation, and rollback behavior are unchanged.
Performance evidence
A fixed 1,554-file snapshot at
0d39d0658was indexed into a new database for each run on macOS ARM64, Release .NET 8, with--parallelism 2 --memory-trace.2602d764e)These are individual observations, not a general speed guarantee or a measurement of peak resident-memory reduction. All runs completed every file without warnings or extraction errors. All pre-existing symbol identities and extraction metadata were preserved; seven constructors were recovered, with the corresponding declaration-reference and resolution updates. The repeat at
2602d764ematched the optimized measurement across all 58,861 symbol records and 555,136 references after normalizing internal database IDs, including reference contexts and source/target symbol records.Validation
dotnet format --verify-no-changes,git diff --check, and changelog validation passed.integrity_ok.Documentation and changelog
Updated
docs/initial-index-performance.mdandTESTING_GUIDE.md, including benchmark limits and regression coverage. Added bilingual fragments:changelog.d/unreleased/+initial-index-ranked-source-probes.changed.mdchangelog.d/unreleased/+initial-index-method-lookahead.changed.mdchangelog.d/unreleased/+initial-index-declaration-probes.changed.mdThis work is not tied to an issue and does not auto-close any issues. A follow-up candidate is profiling the remaining C# prepass cost on larger repositories.
Collaborator checklist