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!
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? /bl
at the command line or using https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.ProjectSystemTools in VS
@rynowak
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?
@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 dotnet build --no-incremental
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: https://github.com/dotnet/roslyn/issues/36963
Most helpful comment
I thought it was just my machine. Guess not...