build-perf-baseline

Solid

Establish build performance baselines and apply systematic optimization techniques. Only activate in MSBuild/.NET build context. USE FOR: diagnosing slow builds, establishing before/after measurements (cold, warm, no-op scenarios), applying optimization strategies like MSBuild Server, static graph builds, artifacts output, and dependency graph trimming. Start here before diving into build-perf-diagnostics, incremental-build, or build-parallelism. DO NOT USE FOR: non-MSBuild build systems, detailed bottleneck analysis (use build-perf-diagnostics after baselining).

Web & Frontend 3,219 stars 238 forks Updated today MIT

Install

View on GitHub

Quality Score: 93/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Build Performance Baseline & Optimization ## Overview Before optimizing a build, you need a **baseline**. Without measurements, optimization is guesswork. This skill covers how to establish baselines and apply systematic optimization techniques. **Related skills:** - `build-perf-diagnostics` — binlog-based bottleneck identification - `incremental-build` — Inputs/Outputs and up-to-date checks - `build-parallelism` — parallel and graph build tuning - `eval-performance` — glob and import chain optimization --- ## Step 1: Establish a Performance Baseline Measure three scenarios to understand where time is spent: ### Cold Build (First Build) No previous build output exists. Measures the full end-to-end time including restore, compilation, and all targets. ```bash # Clean everything first dotnet clean # Remove bin/obj to truly start fresh Get-ChildItem -Recurse -Directory -Include bin,obj | Remove-Item -Recurse -Force # OR on Linux/macOS: # find . -type d \( -name bin -o -name obj \) -exec rm -rf {} + # Measure cold build dotnet build /bl:cold-build.binlog -m ``` ### Warm Build (Incremental Build) Build output exists, some files have changed. Measures how well incremental build works. ```bash # Build once to populate outputs dotnet build -m # Make a small change (touch one .cs file) # Then rebuild dotnet build /bl:warm-build.binlog -m ``` ### No-Op Build (Nothing Changed) Build output exists, nothing has changed. This should be nearly instant. If it's slow, increm...

Details

Author
dotnet
Repository
dotnet/skills
Created
3 months ago
Last Updated
today
Language
C#
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category

Web & Frontend Solid

build-perf-diagnostics

Diagnose MSBuild build performance bottlenecks using binary log analysis. Only activate in MSBuild/.NET build context. USE FOR: identifying why builds are slow by analyzing binlog performance summaries, detecting ResolveAssemblyReference (RAR) taking >5s, Roslyn analyzers consuming >30% of Csc time, single targets dominating >50% of build time, node utilization below 80%, excessive Copy tasks, NuGet restore running every build. Covers timeline analysis, Target/Task Performance Summary interpretation, and 7 common bottleneck categories. Use after build-perf-baseline has established measurements. DO NOT USE FOR: establishing initial baselines (use build-perf-baseline first), fixing incremental build issues (use incremental-build), parallelism tuning (use build-parallelism), non-MSBuild build systems. INVOKES: dotnet msbuild binlog replay with performancesummary, grep for analysis.

3,219 Updated today
dotnet
AI & Automation Solid

benchmark

Use this skill to measure performance baselines, detect regressions before/after PRs, and compare stack alternatives.

201,447 Updated yesterday
affaan-m
Data & Documents Solid

eval-performance

Guide for diagnosing and improving MSBuild project evaluation performance. Only activate in MSBuild/.NET build context. USE FOR: builds slow before any compilation starts, high evaluation time in binlog analysis, expensive glob patterns walking large directories (node_modules, .git, bin/obj), deep import chains (>20 levels), preprocessed output >10K lines indicating heavy evaluation, property functions with file I/O ($([System.IO.File]::ReadAllText(...))), multiple evaluations per project. Covers the 5 MSBuild evaluation phases, glob optimization via DefaultItemExcludes, import chain analysis with /pp preprocessing. DO NOT USE FOR: compilation-time slowness (use build-perf-diagnostics), incremental build issues (use incremental-build), non-MSBuild build systems. INVOKES: dotnet msbuild -pp:full.xml for preprocessing, /clp:PerformanceSummary.

3,219 Updated today
dotnet
Web & Frontend Solid

incremental-build

Guide for optimizing MSBuild incremental builds. Only activate in MSBuild/.NET build context. USE FOR: builds slower than expected on subsequent runs, 'nothing changed but it rebuilds anyway', diagnosing why targets re-execute unnecessarily, fixing broken no-op builds. Covers 8 common causes: missing Inputs/Outputs on custom targets, volatile properties in output paths (timestamps/GUIDs), file writes outside tracked Outputs, missing FileWrites registration, glob changes, Visual Studio Fast Up-to-Date Check (FUTDC) issues. Key diagnostic: look for 'Building target completely' vs 'Skipping target' in binlog. DO NOT USE FOR: first-time build slowness (use build-perf-baseline), parallelism issues (use build-parallelism), evaluation-phase slowness (use eval-performance), non-MSBuild build systems. INVOKES: dotnet build /bl, binlog replay with diagnostic verbosity.

3,219 Updated today
dotnet
AI & Automation Listed

perf

Performance analysis and optimization workflow

10 Updated 6 days ago
jmylchreest