build-perf-baseline
Establish build performance baselines and apply systematic optimization techniques. 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).
npx skills add dotnet/skills --skill build-perf-baseline --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# 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.
- Overview
- Step 1: Establish a Performance Baseline
- Cold Build (First Build)
- Warm Build (Incremental Build)
- No-Op Build (Nothing Changed)
- What Good Looks Like
- Recording Baselines
- Step 2: MSBuild Server (Persistent Build Process)
- Enabling MSBuild Server
- Managing the Build Server
- When to Restart the Build Server
- Step 3: Artifacts Output Layout
- Enabling Artifacts Output
- Before vs After
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
Build once to populate outputs
dotnet build -mWhat does the build-perf-baseline skill do?
Establish build performance baselines and apply systematic optimization techniques. 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).
How do I install it?
Run `npx skills add dotnet/skills --skill build-perf-baseline --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From dotnet/skills, a repository with 4,927 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
