Skip to content

Remove unused NativeAOT metadata collections - #136551

Merged
agocke merged 2 commits into
dotnet:mainfrom
agocke:remove-unused-ilc-metadata
Oct 28, 2026
Merged

agocke merged 2 commits into
dotnet:mainfrom
agocke:remove-unused-ilc-metadata

Conversation

@agocke

@agocke agocke commented Oct 27, 2026

Copy link
Copy Markdown
Member

Removed unused compiled methods and generic dictionaries that have no consumers. Preserve method-body and reflection metadata tracking.

This seems to save ~15s of compile time for azure MCP (5.6%).

Stop collecting compiled methods and generic dictionaries that have no consumers. Preserve method-body and reflection metadata tracking.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: d7781a32-4bd5-4bc1-98e8-78ef1eb83cac
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib
See info in area-owners.md if you want to be subscribed.

Removed unnecessary null check for methodNode and ShadowConcreteMethodNode.
@agocke
agocke enabled auto-merge (squash) October 27, 2026 23:46

@MichalStrehovsky MichalStrehovsky left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find! But the 5.6% saving is kind of hard to believe.

@agocke

agocke commented Oct 28, 2026

Copy link
Copy Markdown
Member Author

I looked at the local benchmarking that AI wrote and it seems reasonable.

Sorted sets are expensive at large scale. They have to do comparisons and the number of comparisons scales with log n of the number of items in the set. So if you have millions of nodes in the set, as azure MCP does, each additional node that gets added is doing ~15 comparisons per addition. If each comparison takes around 100ns and you do 100 million comparisons, that's around 10s of CPU time, which is in the ballpark of what we're looking at.

@agocke

agocke commented Oct 28, 2026

Copy link
Copy Markdown
Member Author

/ba-g infra failure due to permissions change

@agocke
agocke merged commit 4a29a57 into dotnet:main Oct 28, 2026
91 of 100 checks passed
@agocke
agocke deleted the remove-unused-ilc-metadata branch October 28, 2026 22:32
@github-project-automation github-project-automation Bot moved this to Done in AppModel Oct 28, 2026
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants