Repository navigation
perf: stop recompiling every project on every build (release 1.3.0) - #46
Merged
Merged
Conversation
The SDK wrote GeneratedAssemblyInfo.cs and GeneratedAssemblyIdentifier.cs with Overwrite="true" and no WriteOnlyWhenDifferent. Both files are @(Compile) inputs, so CoreCompile could never be up to date and every build recompiled every project. Measured on a 39-project solution: a rebuild with no source changes ran 38 Csc invocations totalling 111.6 s of a 67.7 s build. It now runs none, and that rebuild takes 7.2 s instead of 67.7 s. Also in this release: - remove the AfterTargets="Build" skill recommendation hook, which read and regex-scanned every project assets file (about 500 KB, 256 libraries each) on every build to print advice nobody on CI could act on; the explicit VerifyPurviewSkills gate replaces it and escalates PRSKL0010/0011 to errors - read each .editorconfig in the style-policy chain once instead of twice - skip both repository-file bootstraps on design-time builds, which repeated the repository-root probes and two 95 KB reads per project per IDE edit - keep the tracked .editorconfig version marker in sync with package.json via just version-sync, checked by just version-sync-check in the pre-commit hook BREAKING CHANGE: no skill work runs during a build any more, and EnablePurviewSkillRecommendations, PurviewSkillRecommendationsInCI and PurviewSkillRecommendationStampPath are removed. Use -t:RecommendPurviewSkills to report, -t:VerifyPurviewSkills to fail a pipeline, and -t:InstallPurviewSkills to install.
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.
Why
A rebuild with no source changes on a 39-project solution took 67.7 s and ran 38
Cscinvocations. Two files the SDK generates into every project were written withOverwrite="true"and noWriteOnlyWhenDifferent, and both are@(Compile)inputs - soCoreCompilecould never be up to date. That also silently defeatedAccelerateBuildsInVisualStudio=true.Measured end to end
changeops(39 projects,net11.0,AnalysisMode=All), same machine, no source changes between runs:Cscon the warm rebuildThe first warm build after upgrading is 27.3 s, not 7.2 s - the upgrade invalidates analyzers,
.editorconfigand compiler state at once. Steady state is the next no-change build.Every Purview target in that steady-state build now sums to about 0.9 s of the 7.2 s, with none above 400 ms.
What changed
WriteOnlyWhenDifferent="true"on both generated-file writers.AfterTargets="Build"skill recommendation hook is gone. It read and regex-scanned every project assets file (~500 KB, 256 libraries) on every build to print advice.VerifyPurviewSkillsreplaces it as an explicit gate that escalatesPRSKL0010/PRSKL0011to errors.ValidatePurviewStylePolicyreads each.editorconfigin the chain once, not twice (the SDK own copy is 2,714 lines / 95 KB).DesignTimeBuild, which was repeating the root probes and two 95 KB reads per project on every IDE edit..editorconfigversion marker now syncs frompackage.json(just version-sync), a newjust version-sync-checkguards it, and a pre-commit hook runs it.Breaking change
No skill work runs during a build.
EnablePurviewSkillRecommendations,PurviewSkillRecommendationsInCIandPurviewSkillRecommendationStampPathare removed. Use-t:RecommendPurviewSkillsto report,-t:VerifyPurviewSkillsto fail a pipeline,-t:InstallPurviewSkillsto install. Nothing inpurview-dev/*sets any of the removed properties - checked withgit grepacross every repo.Testing
just pipeline-local-releaseon 1.3.0 passed: 669 tests (47 + 69 + 73 + 480), CSharpier, pack, pack validation, local publish.IncrementalBuildTestspins both generated files: two builds of an unchanged project must leave their timestamps and content alone.DesignTimeBuild_DoesNotBootstrapTheRepositoryFiles.AdoptionPin_MatchesPackageJsonnow covers.editorconfig;version-sync-checkwas verified to fail on a stale marker and pass on a clean one.changeopson 1.3.0: zeroCscon a no-change rebuild, andjust skills-verifyreturns 0 silently.Deliberately not changed
ImportProjectReferencedBuildTransitiveAssetslooked like the next target (~2 s in the target summary) but toggling it off on a steady-state build gave 7.99 s against 7.20 s with it on - no measurable cost.AnalysisMode=Allis intentional policy. Both are recorded indocs/wiki/Performance.mdso they are not re-litigated.