Delay computing display names of type system entities#119524
Merged
MichalStrehovsky merged 1 commit intodotnet:mainfrom Sep 11, 2025
Merged
Delay computing display names of type system entities#119524MichalStrehovsky merged 1 commit intodotnet:mainfrom
MichalStrehovsky merged 1 commit intodotnet:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR optimizes the dataflow analysis by delaying computation of display names for type system entities. Instead of eagerly computing display names that are often unused, the code now stores the original TypeSystemEntity objects and only computes display names when actually needed.
Key Changes
- Change method signatures to accept TypeSystemEntity instead of string for reason parameters
- Add new overloaded methods in ReflectionMarker that accept TypeSystemEntity parameters and compute display names on-demand
- Update call sites to pass TypeSystemEntity objects instead of pre-computed display names
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| TrimAnalysisAssignmentPattern.cs | Changed Reason property and constructor parameter from string to TypeSystemEntity |
| RequireDynamicallyAccessedMembersAction.cs | Updated constructor and field to use TypeSystemEntity instead of string |
| ReflectionMethodBodyScanner.cs | Updated method calls to pass TypeSystemEntity objects instead of display names |
| ReflectionMarker.cs | Added overloaded methods accepting TypeSystemEntity and moved display name computation inside methods |
| HandleCallAction.cs | Changed reason field and constructor parameter from string to MethodDesc |
| GenericArgumentDataFlow.cs | Updated RequireDynamicallyAccessedMembersAction constructor call |
| AttributeDataFlow.cs | Updated RequireDynamicallyAccessedMembers calls to pass TypeSystemEntity |
Contributor
|
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas |
3 tasks
jkotas
approved these changes
Sep 11, 2025
sbomer
approved these changes
Sep 11, 2025
Member
Author
|
/ba-g Simulator failure on android leg |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Ran into this in the profiles for #119385 but it's orthogonal. We were trying to compute display names of things even though we don't need them - in particular, for every call the dataflow analysis sees, we were computing a display name of the called method and throwing it away most of the time.