-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Improve method body interning and deduplication logic #117080
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* Enhanced ObjectDataInterner to perform multiple iterations of interning. * Consider two same `MethodReadOnlyDataNode` the same.
|
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the object data interning process by running multiple interning iterations and treats identical MethodReadOnlyDataNode instances as duplicates, while also adding logic to skip emitting deduplicated read-only data nodes.
- Run interning in a loop until no new mappings are found
- Extend
MethodInternComparerto considerMethodReadOnlyDataNodecontent equality - Add
ShouldSkipEmittingObjectNodeto avoid emitting already-interned read-only data
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectDataInterner.cs | Introduce a loop over interning passes and update comparer to handle method RO data |
| src/coreclr/tools/Common/Compiler/DependencyAnalysis/MethodReadOnlyDataNode.cs | Add override to skip emitting deduplicated MethodReadOnlyDataNode |
Comments suppressed due to low confidence (2)
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectDataInterner.cs:31
- The new iterative interning loop in
EnsureMapshould be covered by unit tests to verify that duplicates are progressively deduplicated across multiple iterations.
do
src/coreclr/tools/Common/Compiler/DependencyAnalysis/MethodReadOnlyDataNode.cs:21
- Add unit tests for
ShouldSkipEmittingObjectNodeto ensure that read-only data nodes are correctly skipped when they have been interned elsewhere.
public override bool ShouldSkipEmittingObjectNode(NodeFactory factory)
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectDataInterner.cs
Show resolved
Hide resolved
Size statisticsPull request #117080
|
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectDataInterner.cs
Outdated
Show resolved
Hide resolved
How many iterations do we typically get for larger apps like |
jkotas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
TodosApi gets 6 iterations: Iteration done, 14957 folded |
MethodReadOnlyDataNodethe same.Cc @dotnet/ilc-contrib