Investigating analyzer impact on build times
See original GitHub issueStyleCop Classic used to write information about files it analyzed, including analysis results, in an XML cache called StyleCop.Cache
, to speed the time it takes to analyze a project if some of the source code files are unchanged in the meantime. Although StyleCop Analyzers also has caches, they are limited to storing using
aliases and copyright texts, but nothing like a results cache like StyleCop Classic used to have.
In my experience, running the StyleCop analyzer takes a considerable part of a project’s build time even if it ultimately finds few or no violations, and I feel that having a results cache (like StyleCop.Cache
) will speed up this time because StyleCop would then focus analysis on only those files that have changed, which is often not many files.
Issue Analytics
- State:
- Created 4 years ago
- Comments:29 (19 by maintainers)
Top GitHub Comments
@peteroupc If the results from ReportAnalyzer don’t show in your output, you can add
/bl:Build.binlog
to your MSBuild command line as well. This will create an output file Build.binlog that you can open with the MSBuild Structured Log Viewer. This output format contains the information you would normally see with diagnostic level output, but is much faster than/v:d
and the log viewer contains search functionality.When you open the log in the viewer, you’ll want to search for the following:
Then you can click on a line on the left pane to get details.
For one project of mine, the build time (
msbuild /t:rebuild
) was—resulting in almost triple the build time. This project used no other analyzers than StyleCop Analyzers.