build-perf-diagnostics

Diagnose MSBuild build performance bottlenecks by analyzing binary log performance summaries.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Slow .NET builds are hard to diagnose without visibility into where time is spent. This Skill analyzes MSBuild binary logs (binlogs) to pinpoint the exact targets, tasks, and projects consuming build time, turning vague "builds are slow" complaints into concrete, prioritized fixes. ## Core Features & Use Cases - Binlog Performance Analysis: Replays binlogs to text logs with performance summaries and extracts Target/Task Performance Summary data to find expensive build steps. - Seven Bottleneck Categories: Detects ResolveAssemblyReference slowness (>5s), Roslyn analyzers consuming >30% of Csc time, serialization bottlenecks, excessive Copy task I/O, evaluation overhead, redundant NuGet restore, and poor project graph shape. - Impact-Prioritized Reporting: Categorizes findings as high impact (>10% of build time), medium impact (2-10%), or quick wins (property flag changes in Directory.Build.props). - Use Case: A team's solution build takes 8 minutes. Use this Skill to replay the binlog, discover that analyzers consume 45% of Csc time and RAR takes 12s per project, then apply conditional analyzer settings and reference trimming to cut build time significantly. ## Quick Start Ask the AI to analyze why your build is slow by generating a binlog with dotnet build /bl and diagnosing the performance bottlenecks.

Frequently Asked Questions about build-perf-diagnostics

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

FAQPage Schema
How do I find out why my MSBuild or dotnet build is slow?

Generate a binary log with dotnet build /bl -m, then replay it with dotnet msbuild build.binlog -flp:v=diag;performancesummary. The Target and Task Performance Summary sections at the end of the log list all build steps sorted by cumulative time.

How to analyze a binlog without the MSBuild Structured Log Viewer?

Replay the binlog to a text log using dotnet msbuild build.binlog -noconlog -fl -flp:v=diag;logfile=full.log;performancesummary, then grep for Target Performance Summary and Task Performance Summary sections to find expensive targets and tasks.

Why is ResolveAssemblyReference slow in my build?

RAR taking over 5 seconds usually indicates too many assembly references, network-based reference paths, or large search paths. Reduce transitive references with DisableTransitiveProjectReferences, trim unused PackageReferences, and set ReferenceOutputAssembly=false on build-only project references.

How do I reduce Roslyn analyzer impact on build time?

Disable analyzers conditionally in the dev inner loop with RunAnalyzers set to false when ContinuousIntegrationBuild is not true, while keeping enforcement in CI. Compare Csc task duration with and without /p:RunAnalyzers=false to measure the actual overhead.

What are the thresholds for MSBuild performance problems?

Node utilization below 80% indicates serialization bottlenecks, a single target over 50% of build time needs investigation, analyzers should stay under 30% of Csc time, and RAR over 5 seconds is concerning while over 15 seconds is pathological.

When should I not use build performance diagnostics?

Do not use it to establish initial baselines, which requires a baseline measurement skill first. It also does not cover fixing incremental build issues, parallelism tuning, or non-MSBuild build systems.