Build performance concerns.
See original GitHub issueI’ve got a small project that takes 3 seconds to compile without stylecop analyzers, adding them to the project increases compilation time to 13 seconds. It’s not an issue for CI or manual(command line) build, but I definitely would not expect 400% percent longer builds in Visual Studio during development time especially taking into account that validation happens in background during file editing(incremental compilation) anyway. Is there any way to disable analyzers completely for VBCSCompiler when I build from Visual Studio? I tried the following hack, it disables analyzers for debug builds, but the build still takes 5-6 seconds instead of expected 3.
public static void HandleCompilationStart(CompilationStartAnalysisContext context)
{
if (context.Options.GetType().FullName == "Microsoft.CodeAnalysis.Diagnostics.WorkspaceAnalyzerOptions" || context.Compilation.Options.OptimizationLevel == OptimizationLevel.Release)
{
// ...
}
}
Thoughts?
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:15 (7 by maintainers)
Top Results From Across the Web
Dealing with Performance Problems
Quantity of work (untimely completion, limited production). Poor prioritizing, timing, scheduling; Lost time ; Quality of work (failure to meet quality standards).
Read more >Troubleshoot build performance with Build Analyzer
Use the Build Analyzer to inspect the build performance of your project. For each build you perform, the Build Analyzer tries to present...
Read more >5 Best Practices in Performance Management That Will ...
Common performance management problems include: Poor prioritizing and time management. Lack of efficiency.
Read more >Four Steps for Addressing Performance Problems
The first question is a check to make sure that the problem is really a performance problem (the person isn't meeting expectations around...
Read more >Managing Poor Performance: 5 Steps
Addressing poor performance at work is an incredibly valuable skill as a manager. We're here with a 5-step guide to helping employees improve....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@NikGovorov Just add the following at the end of your project file:
For users who enable “warnings as errors” and users who use a rule set file to treat specific analyzer warnings as errors, which would cause building in Visual Studio to produce different results than building from the command line. This would dramatically increase the chances that developers commit code they believe works but in reality causes the automated build for their project to fail.
This issue is sufficiently important that I am quite comfortable advising people to avoid this build customization and instead focus on continually reducing the performance overhead of the StyleCop Analyzers.
That said, I’ll open a new issue to include this information somewhere in the documentation. (It’s #1711.)