Speed up initial full indexing - #5079
Merged
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
Root cause and impact
The empty-database path combined very large named-parameter statements with repeated graph candidate probes and duplicate temporary materialization.
Microsoft.Data.Sqliteresolves parameter names during binding, so the previous 994-parameter reference statements were particularly expensive. The graph phase then repeated persistent candidate lookups and target-key construction over roughly one million candidate rows.Measured on this repository with a new empty database:
origin/mainbaselineThe branch measurement indexed 1,411 files and 491,013 references, versus 1,399 files and 489,997 references in the baseline. Three preceding comparable branch runs had a 64.534 s median (64.351–86.887 s), with the slower first run reflecting cold-cache variance.
Validation
net8.0: 11,420 passed, 7 skipped, 0 failednet9.0: 10,948 passed, 418 skipped, 0 faileddotnet format CodeIndex.sln --verify-no-changes --no-restoredotnet run --project tools/CodeIndex.Changelog --no-restore -- check(14 fragments validated)No blocking/actionable issues found.Documentation and changelog
Updated the English/Japanese developer and testing guidance. Added these bilingual unreleased fragments:
changelog.d/unreleased/+initial-index-write-batches.changed.mdchangelog.d/unreleased/+manual-performance-opt-in.changed.mdchangelog.d/unreleased/+compact-lower-rank-candidates.changed.mdchangelog.d/unreleased/+reference-resolution-symbol-facts.changed.mdchangelog.d/unreleased/+csharp-prepass-segmented-workspace.changed.mdchangelog.d/unreleased/+csharp-workspace-type-lookups.changed.mdchangelog.d/unreleased/+reference-line-window-sizing.changed.mdchangelog.d/unreleased/+csharp-property-receiver-facts.changed.mdchangelog.d/unreleased/+fresh-reference-source-attribution.changed.mdchangelog.d/unreleased/+csharp-type-family-candidates.changed.mdFollow-ups
Raw ordinal SQLite binding and candidate-schema compression remain possible higher-risk follow-ups; neither is required for this improvement set.