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

Optimize namespace comparisons #17119

Merged
merged 3 commits into from
Nov 15, 2019
Merged

Optimize namespace comparisons #17119

merged 3 commits into from
Nov 15, 2019

Conversation

rynowak
Copy link
Member

@rynowak rynowak commented Nov 15, 2019

Fixes: #16922

Improves the performance significantly by avoiding allocations for the
purpose of comparing the namespace.

Fixes: #16922

Improves the performance significantly by avoiding allocations for the
purpose of comparing the namespace.
@rynowak rynowak requested a review from pranavkm November 15, 2019 03:05
@github-actions github-actions bot added the area-blazor Includes: Blazor, Razor Components label Nov 15, 2019
@@ -27,17 +30,25 @@ public ComponentInternalUsageDiagnosticAnalyzer()

public override void Initialize(AnalysisContext context)
{
context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics);
Copy link
Member Author

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,
Copy link
Member Author

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? 🤷‍♂

@rynowak
Copy link
Member Author

rynowak commented Nov 15, 2019

Before

image

After

image

@rynowak
Copy link
Member Author

rynowak commented Nov 15, 2019

@aspnet-hello
Copy link

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)
https://github.com/aspnet/AspNetCore-Internal/issues/3390

…nalzyer.cs

Co-Authored-By: Pranav K <prkrishn@hotmail.com>
@rynowak
Copy link
Member Author

rynowak commented Nov 15, 2019

@pranavkm - good catch

@rynowak rynowak merged commit 2ff8f45 into master Nov 15, 2019
@rynowak rynowak deleted the rynowak/operation-analyzer branch November 15, 2019 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Analyzer processing of generated code causes significant slowdown in build
5 participants