build-perf-baseline

Establishes MSBuild performance baselines and applies systematic build optimization techniques.

Updated Jul 12, 2026
One-click install
npx skills add https://github.com/Patrick-Rex/DotNetTechSamples --skill build-perf-baseline-patrick-rex
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: build-perf-baseline
Source: https://github.com/Patrick-Rex/DotNetTechSamples/tree/main/.agents/plugins/dotnet-msbuild/skills/build-perf-baseline
Command: npx skills add https://github.com/Patrick-Rex/DotNetTechSamples --skill build-perf-baseline-patrick-rex

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Slow .NET builds waste developer time, but optimizing without measurements is guesswork. This Skill provides a structured method to measure cold, warm, and no-op build times, then apply targeted optimizations like MSBuild Server, artifacts output, static graph builds, and dependency graph trimming. ## Core Features & Use Cases - Baseline Measurement: Capture cold, warm, and no-op build timings with binary logs to identify whether incremental build, restore, or compilation is the bottleneck. - Optimization Techniques: Enable MSBuild Server, UseArtifactsOutput layout, deterministic builds, parallel tuning with -m, and static graph builds via /graph. - Dependency Graph Trimming: Remove redundant ProjectReferences, use ReferenceOutputAssembly="false" for build-order-only dependencies, and shorten the critical path. - Use Case: Your solution's no-op build takes 45 seconds. Use this Skill to baseline all three scenarios, discover incremental build is broken, then follow the decision tree to the incremental-build skill for the fix. ## Quick Start Ask the AI to measure cold, warm, and no-op build times for your .NET solution and recommend optimizations based on the results.

Frequently Asked Questions about build-perf-baseline

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I measure .NET build performance?▼

Measure three scenarios: cold build after deleting bin/obj folders, warm build after touching one source file, and no-op build with no changes. Use dotnet build with /bl to capture binary logs for each scenario and compare timings in a before/after table.

How to speed up a slow dotnet build?▼

Start by baselining cold, warm, and no-op builds to find where time goes. Then apply targeted fixes: enable MSBuild Server, use /graph for static graph builds, trim redundant ProjectReferences, separate restore from build, and tune parallelism with -m.

What is a good no-op build time for MSBuild?▼

A no-op build should take under 5 seconds for small repos and under 30 seconds for large repos, with all compilation targets reporting up-to-date. If it exceeds 30 seconds, incremental build is broken and Inputs/Outputs declarations need fixing.

When should I use dotnet build /graph?▼

Use /graph for large solutions with 20 or more projects and in CI, where static graph evaluation improves scheduling and parallelism. Avoid it for small solutions under 5 projects where graph evaluation overhead outweighs the benefits.

Why does my warm build recompile everything?▼

Full recompilation on warm builds usually means the project dependency chain forces downstream rebuilds. Trim redundant transitive ProjectReferences, use ReferenceOutputAssembly="false" for build-order-only dependencies, and check the binlog for the triggering project.

What does UseArtifactsOutput do in .NET?▼

UseArtifactsOutput, introduced in .NET 8, redirects all build output into a single artifacts directory with unique paths per project and configuration. It eliminates bin/obj clashes, simplifies CI caching, and reduces .gitignore maintenance.