-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Optimize namespace comparisons #17119
Conversation
Fixes: #16922 Improves the performance significantly by avoiding allocations for the purpose of comparing the namespace.
src/Components/Analyzers/src/ComponentInternalUsageDiagnosticAnalzyer.cs
Outdated
Show resolved
Hide resolved
@@ -27,17 +30,25 @@ public ComponentInternalUsageDiagnosticAnalyzer() | |||
|
|||
public override void Initialize(AnalysisContext context) | |||
{ | |||
context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); |
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.
I wanted this to be explicit so it's clear that we mean to do it.
@@ -40,6 +40,7 @@ public void Register(AnalysisContext context) | |||
context.RegisterOperationAction( | |||
AnalyzeOperation, | |||
OperationKind.ObjectCreation, | |||
OperationKind.Invocation, |
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.
This was part of my previous PR. I'm not sure how it got left out? 🤷♂
This comment was made automatically. If there is a problem contact aspnetcore-build@microsoft.com. I've triaged the above build. I've created/commented on the following issue(s) |
src/Components/Analyzers/src/ComponentInternalUsageDiagnosticAnalzyer.cs
Outdated
Show resolved
Hide resolved
src/Components/Analyzers/src/ComponentInternalUsageDiagnosticAnalzyer.cs
Outdated
Show resolved
Hide resolved
…nalzyer.cs Co-Authored-By: Pranav K <prkrishn@hotmail.com>
@pranavkm - good catch |
Fixes: #16922
Improves the performance significantly by avoiding allocations for the
purpose of comparing the namespace.