-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Investigate analyzer slowness #11172
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
Comments
I thought it was just my machine. Guess not... |
Hmm, we did a bunch of SDK work in preview6. Maybe one of these is affect the build. |
Does this reproduce at the command-line? Could either of you capture a binary log? |
Since no one else have attached a binary log, I'll do it :) This is a completely new project and I simply hit Build after making a small change. It took about 5 seconds. However on my actual project it takes around 8 seconds aswell. |
@rynowak Any updates? :) |
@kevinjpetersen could you edit your project file: <PropertyGroup>
<DisableImplicitAspNetCoreAnalyzers>true</DisableImplicitAspNetCoreAnalyzers>
</PropertyGroup> and see if it helps? We added a couple of new analyzers recently and I think it's adding to the bulk of the compilation time. |
@pranavkm Yes that helped significantly! |
Is there any downside of disabling it? @pranavkm |
We use analyzers as a way to provide build time guidance for correctness of code, so I'd certainly not recommend turning it off on a long term basis. But it should be perfectly fine to disable it until we get to the bottom of this |
@NTaylorMullen perhaps this is the analyzer you wrote recently? |
It's possible but we're not doing anything crazy in that analyzer. I'd definitely be surprised. I'll take a look quickly |
So profiled this a bit and on a semi-slow VM for preview6 Blazor app running
Disabled the new analyzer I added and there was 0 difference in performances. That being said, analyzers running almost doubling the build time doesn't seem great. @pranavkm is that expected? |
Just confirming that I've reproduced this too and we definitely need to look into this. It's a massive difference (even more so in VS compared to the CLI). @mkArtakMSFT I don't think this is anything specific to Blazor, it affects anything using the Web SDK it seems. |
@NTaylorMullen I've moved this back to preview 8. Can you please prioritize this over the rest of Preview 8 work, as it seems this impacts the build performance - including our builds. |
Investigated this and it looks to be an issue with Roslyn. When Analyzers are included in a users project their build server doesn't 100% fulfill a compilation requests at which point they fallback and start a new Csc process. Logged an issue on their end with more details: dotnet/roslyn#36963 |
Uh oh!
There was an error while loading. Please reload this page.
I downloaded the latest preview 6, created a new project from default template and instantly noticed a massive difference in compiling time, I attach the difference in compile time Preview 5 vs Preview 6.
Preview 5 (less than 1 second)

Preview 6 ( 8 seconds )

I tried the latest VisualStudio Community Edition 16.1.3 and the Preview edition 16.2.0 Preview 2.0, and both behave the same, with the same issue.
I also downloaded the latest Preview 7 from daily builds (12386), and it behaves as Preview 6, I just didn't attach that gif capture.
I also installed and uninstalled the sdk & visual studio several times to discard install issues.
Regards!
The text was updated successfully, but these errors were encountered: