Build perf is negatively impacted
See original GitHub issueRunning PerfView during the build of the PInvoke project, I see that almost a full second goes to the GetBuildVersion task, which seems to be doing some repeat work perhaps within the same task execution, and certainly across projects. Can we cache the results across projects?
Name Inc % Inc
nerdbank.gitversioning.tasks!GetBuildVersion.Execute 2.2 939
+ nerdbank.gitversioning!VersionOracle.Create 2.2 935
|+ nerdbank.gitversioning!Nerdbank.GitVersioning.VersionOracle..ctor(class System.String,class LibGit2Sharp.Repository,class Nerdbank.GitVersioning.ICloudBuild) 2.2 919
||+ nerdbank.gitversioning!GitExtensions.GetVersionHeight 0.9 381
||+ nerdbank.gitversioning!GitExtensions.GetIdAsVersion 0.8 340
||+ nerdbank.gitversioning!VersionFile.GetVersion 0.4 181
Opportunities:
- Add an incremental build aspect to the
GetBuildVersion
target where the results are saved to a file with the cache key being the tuple: version.json timestamp (and path?) and commit id. (@japj’s idea) - Cache the height for one or more commits so even if the commit advances, we quickly find a commit whose height was predetermined in the cache file and cut off the potentially long git history traversal (@djluck’s idea)
- #508 Cut down on redundant
GetBuildVersion
executions per-project that @djluck identified, possibly by using theMSBuild
task call to invoke another target but with a reduced set of global properties to improve target skipping around P2P and TargetFramework invocations. - #508 Build on the shared MSBuild target invocation within a single project to share it across projects based on a project property that specifies the directory path for which version.json will be searched for and used as the ‘cache key’ for reuse. This key can be a global property in the MSBuild task invocation to automatically cache at the right level, and this same property can serve as the input for the version.json search.
- #507 Never parse the same version.json content twice
- Tell libgit2sharp to diff without considering file renames per @djluck’s comment.
Issue Analytics
- State:
- Created 7 years ago
- Comments:36 (13 by maintainers)
Top Results From Across the Web
4.8. About Perf Red Hat Enterprise Linux for Real Time 7
Sampling at too high a frequency can negatively impact the performance of your real-time system. Previous · Next ...
Read more >Troubleshoot build performance with Build Analyzer
You can use this information to determine whether unexpected dependency downloads are negatively impacting your build performance.
Read more >Performance-enhancing drugs: Know the risks
Testosterone has two main effects on the body: Helps build muscle. Causes features such as facial hair and a deeper voice. The anabolic...
Read more >Profile your build | Android Studio
Learn how to profile your build to help optimize build speed. ... might negatively impact performance on low-memory machines.
Read more >How Brand Building and Performance Marketing Can Work ...
We know that performance marketing can have a profound impact—positive or negative—on a brand. Our three brand owners have taken steps to ensure...
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 Free
Top 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
I’m preparing a change that should bring the number of
GetBuildVersion
invocations from(projects * targetframeworks)
to just(projects)
(which should help @djluck) and down to exactly 1 when there is just one version.json file in the repo and the repo ‘opts in’ to sharing version info across projects.I tried version 3.3.22-alpha with the added
GitVersionBaseDirectory
property and I no longer see theGetBuildVersion
task in the MSBuild performance traces at all; neither for the full rebuild nor for the incremental one. There are two invocations ofGetBuildVersionCore
that together consume around 126ms of time: