Skip to content
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

Remove expensive call to ApplyPolicy #66845

Merged
merged 1 commit into from
Feb 14, 2023
Merged

Remove expensive call to ApplyPolicy #66845

merged 1 commit into from
Feb 14, 2023

Conversation

jaredpar
Copy link
Member

This removes the call to ApplyPolicy from our .NET Framework analyzer loading story. This call applies host policy to the given display name. That was likely added back in the days where we used LoadFile in the generator and hence needed to manually handle policy. These days though all our calls are via LoadFrom which has policy implicitly applied.

Further this code path is only used as a final fall back now. By the time we get here it's assumed the host does not control the reference that is being loaded, it's owned by the analyzer. That means policy shouldn't even really apply.

Removing this because it's unneeded and leads to perf issues in VS

https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1742924

This removes the call to `ApplyPolicy` from our .NET Framework analyzer
loading story. This call applies host policy to the given display name.
That was likely added back in the days where we used `LoadFile` in the
generator and hence needed to manually handle policy. These days though
all our calls are via `LoadFrom` which has policy implicitly applied.

Further this code path is only used as a final fall back now. By the
time we get here it's assumed the host does not control the reference
that is being loaded, it's owned by the analyzer. That means policy
shouldn't even really apply.

Removing this because it's unneeded and leads to perf issues in VS

https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1742924
@jaredpar jaredpar requested a review from a team as a code owner February 13, 2023 16:43
@jaredpar jaredpar added this to the 17.6 milestone Feb 13, 2023
@jaredpar
Copy link
Member Author

@dotnet/roslyn-compiler, @davkean

@jaredpar jaredpar merged commit 9e7c900 into dotnet:main Feb 14, 2023
@jaredpar jaredpar deleted the policy branch February 14, 2023 04:14
@ghost ghost modified the milestones: 17.6, Next Feb 14, 2023
@RikkiGibson RikkiGibson modified the milestones: Next, 17.6 P2 Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants