Cut the CI build time: analyzers once per project, cache NuGet - #3171
Merged
Conversation
The .NET Build step was ~4 minutes on the Windows runner. Measured with /p:ReportAnalyzer=true across all 42 compilations of a clean build: analyzers are 226s of CPU and ~40% of wall time, of which StyleCop is 155s and PublicApiAnalyzers 37s. Our own analyzer and generators are 5.2s - about 2% - so they are not the problem. Restore is another ~80s, uncached on both runners. - run analyzers on one TFM per project (the newest it builds) rather than once per TFM: every rule we run is TFM-agnostic, so a six-TFM library was paying for the same diagnostics six times. Generators are unaffected. /p:RunAnalyzers=true gets the full per-TFM sweep back. - StyleCop applies to src/ only; it was buying nothing in tests/ and toys/ that review does not. - cache ~/.nuget/packages in both CI jobs. - --no-build on the CI test steps, which were each re-entering the build for ~15s. - drop GeneratePackageOnBuild from RESPite.Benchmark, which packed a nupkg on every Release build; the pack step still publishes it. Clean full build locally: 26.7s -> ~19s, Csc CPU 110-124s -> 70-83s.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The .NET Build step was ~4 minutes on the Windows runner. Measured with /p:ReportAnalyzer=true across all 42 compilations of a clean build: analyzers are 226s of CPU and ~40% of wall time, of which StyleCop is 155s and PublicApiAnalyzers 37s. Our own analyzer and generators are 5.2s - about 2% - so they are not the problem. Restore is another ~80s, uncached on both runners.
Clean full build locally: 26.7s -> ~19s, Csc CPU 110-124s -> 70-83s.
Checklist