Reduce rebuild memory amplification - #5068
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
Before/after profile
Same-machine Release rebuild command:
dotnet ./src/CodeIndex/bin/Release/net8.0/cdidx.dll index . --rebuild --yes --memory-trace --json --no-progressfd3c303)71b4e920)The after run indexed 1,261 files, persisted all 47,607 extracted symbols and all 477,700 extracted references, left every graph/index trust flag ready, and reported zero reference-cap hits. Relative to the baseline recorded in #5056, the after run reduced total allocations by 13.7%, peak working set by 31.9%, and elapsed time by 4.3%.
A stable synthetic regression fixture covering 1,000 dense C# generic properties measured 6,495,928 allocated bytes after the change versus 7,015,928 before it (-7.4%), with a 6,800,000-byte ceiling.
Validation
dotnet restore CodeIndex.slndotnet build CodeIndex.sln -c Release --no-restore -p:UseSharedCompilation=false— net8.0/net9.0, 0 warnings, 0 errorsdotnet format CodeIndex.sln --verify-no-changes --no-restoredotnet run --project tools/CodeIndex.Changelog -- checkDocumentation and changelog
DEVELOPER_GUIDE.md.changelog.d/unreleased/5056.changed.md.Follow-ups
None.
Fixes #5056