build-perf-diagnostics
Diagnose MSBuild build performance bottlenecks using binary log analysis. 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 baseli
npx skills add dotnet/skills --skill build-perf-diagnostics --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.
## Performance Analysis Methodology 1. **Generate a binlog**: `dotnet build /bl:{} -m` 2. Use the **binlog MCP server** (`Microsoft.AITools.BinlogMcp`, exposed under the `binlog` MCP namespace) which is bundled with this plugin ### Alternate flow when MCP is unavailable: binlog replay to text logs 1. **Generate a binlog**: `dotnet build /bl:{} -m` 2. **Replay to diagnostic log with performance summary**: ```bash dotnet msbuild build.binlog -noconlog -fl -flp:v=diag;logfile=full.log;performancesummary ``` 3. **Read the performance summary** (at the end of `full.log`): ```bash grep "Target Performance Summary\|Task Performance Summary" -A 50 full.log ``` 4. **Find expensive targets and tasks**: The PerformanceSummary section lists all targets/tasks sorted by cumulative time 5. **Check for node utilization**: grep for scheduling and node messages ```bash grep -i "node.*assigned\|building with\|scheduler" full.log | head -30 ``` 6. **Check analyzers**: grep for analyzer timing ```bash grep -i "analyzer.*elapsed\|Total analyzer execution time\|CompilerAnalyzerDriver" full.log ``` ## Key Metrics and Thresholds - **Build duration**: what's "normal" — small project <10s, medium <60s, large
- Performance Analysis Methodology
- Alternate flow when MCP is unavailable: binlog replay to text logs
- Key Metrics and Thresholds
- Common Bottlenecks
- 1. ResolveAssemblyReference (RAR) Slowness
- 2. Roslyn Analyzers and Source Generators
- 3. Serialization Bottlenecks (Single-threaded targets)
- 4. Excessive File I/O (Copy tasks)
- 5. Evaluation Overhead
- 6. NuGet Restore in Build
- 7. Large Project Count and Graph Shape
- Using Binlog Replay for Performance Analysis
- Quick Wins Checklist
- Impact Categorization
dotnet msbuild build.binlog -noconlog -fl -flp:v=diag;logfile=full.log;performancesummary grep "Target Performance Summary\|Task Performance Summary" -A 50 full.log grep -i "node.*assigned\|building with\|scheduler" full.log | head -30 grep -i "analyzer.*elapsed\|Total analyzer execution time\|CompilerAnalyzerDriver" full.log grep "done building project\|Project Performance Summary" full.log grep -i "node.*assigned\|RequiresLeadingNewline\|Building with" full.log | head -30 grep -i "Total analyzer execution time\|analyzer.*elapsed\|CompilerAnalyzerDriver" full.log grep 'Target "CoreCompile"\|Target "ResolveAssemblyReferences"' full.log
What does the build-perf-diagnostics skill do?
Diagnose MSBuild build performance bottlenecks using binary log analysis. 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 baseli
How do I install it?
Run `npx skills add dotnet/skills --skill build-perf-diagnostics --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.
