본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)5.8k · #14599

eval-performance

하는 일

이 스킬은 컴파일이 시작되기 전에 MSBuild가 하는 작업을 진단합니다. 이 작업은 큰 프로젝트에서 느릴 수 있습니다. 컴파일 전에 빌드가 느린 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓컴파일이 시작되기도 전에 빌드가 느릴 때.
  • ✓바이너리 로그에서 평가 시간이 크게 나타날 때.
  • ✓파일 패턴이 의존성이나 git 폴더처럼 아주 큰 폴더를 훑을 때.

스킬 링크

https://github.com/dotnet/skills/blob/main/plugins/dotnet-msbuild/skills/eval-performance/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/dotnet/skills/blob/main/plugins/dotnet-msbuild/skills/eval-performance/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 .NET 빌드가 컴파일 전에 2분 동안 평가를 합니다. 로그에서 원인을 찾아 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트가 먼저 평가 시간을 측정하고, 넓은 파일 패턴, 깊은 가져오기, 비싼 속성 함수를 찾으며, 측정으로 비용이 드러난 곳에만 목표를 정한 변경을 추천합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Diagnosing MSBuild Evaluation Performance

Evaluation is the work MSBuild does before any target runs — reading project files, processing imports, expanding globs. This skill helps you find and confirm evaluation bottlenecks. Measure first; recommend a change only when a measurement proves it is warranted.

Confirm the problem before changing anything

Engage only when evaluation is measurably the bottleneck. Do NOT act when:

  • The slowness is during compilation or target execution, not evaluation. That is not an evaluation problem — use build-perf-diagnostics instead.
  • The complaint is "rebuilds too much" / incremental build. Use incremental-build instead.
  • You have no measurement. If no binlog or timing summary shows evaluation is slow, gather one first (see below). Do not guess from reading project files.
  • A pattern below appears but evaluation is already fast. Broad globs, deep imports, or EnableDefaultItems are only worth flagging when the numbers show they cost real time. A project that evaluates quickly needs no change.

When a pattern is present but unmeasured, report it as an observation and let the user decide — do not rewrite working configuration to match a "best practice" without evidence it costs measurable evaluation time. Prefer the smallest, most targeted change; never disable SDK defaults as a first move.

MSBuild Evaluation Phases

For a comprehensive overview of MSBuild's evaluation and execution model, see Build process overview.

  1. Initial properties: environment variables, global properties, reserved properties
  2. Imports and property evaluation: process <Import>, evaluate <PropertyGroup> top-to-bottom
  3. Item definition evaluation: <ItemDefinitionGroup> metadata defaults
  4. Item evaluation: <ItemGroup> with Include, Remove, Update, glob expansion
  5. UsingTask evaluation: register custom tasks

Key insight: evaluation happens BEFORE any targets run. Slow evaluation = slow build start even when nothing needs compiling.

Diagnosing Evaluation Performance

Primary: binlog MCP (preferred)

Use the binlog MCP server (Microsoft.AITools.BinlogMcp, exposed under the binlog MCP namespace) to analyze evaluation performance:

  1. Use the evaluations tool to list all evaluations and their durations
  2. Use evaluation_global_properties to check for multiple evaluations with differing global properties
  3. Use evaluation_properties to inspect evaluated properties for a specific project+TFM
  4. Use imports tool to analyze the import chain depth and structure
  5. Use properties tool to check for expensive property function evaluations

Fallback: text-log replay and preprocessing (when MCP is unavailable)

Using binlog

  1. Replay the binlog: dotnet msbuild build.binlog -noconlog -fl "-flp:v=diag;logfile=full.log"
  2. Search for evaluation events: grep -i 'Evaluation started\|Evaluation finished' full.log
  3. Multiple evaluations for the same project = overbuilding
  4. Look for "Project evaluation started/finished" messages and their timestamps

Using /pp (preprocess)

  • dotnet msbuild -pp:full.xml MyProject.csproj
  • Shows the fully expanded project with ALL imports inlined
  • Use to understand: what's imported, import depth, total content volume
  • Large preprocessed output (>10K lines) = heavy evaluation

Using /clp:PerformanceSummary

  • Add to build command for timing breakdown
  • Shows evaluation time separately from target/task execution

Expensive Glob Patterns

Only pursue these remedies once a measurement shows item evaluation is slow and the globs are the cause; a custom glob that isn't walking large trees is fine.

  • Globs like **/*.cs walk the entire directory tree
  • Default SDK globs are optimized, but custom globs may not be
  • Problem: globbing over node_modules/, .git/, bin/, obj/ — millions of files
  • Remedy: use <DefaultItemExcludes> to exclude large directories
  • Remedy: be specific with glob paths: src/**/*.cs instead of **/*.cs
  • Remedy: use <EnableDefaultItems>false</EnableDefaultItems> only as a last resort (loses SDK defaults) — prefer the two options above first
  • Check: grep for Compile items in the diagnostic log → if Compile items include unexpected files, globs are too broad

Import Chain Analysis

  • Deep import chains (>20 levels) slow evaluation
  • Each import: file
자주 묻는 질문

평가란 무엇인가요?

MSBuild가 빌드하기 전에 프로젝트 파일, 가져오기, 파일 패턴을 읽는 단계입니다.

증거 없이 설정을 바꾸나요?

아니요. 패턴을 보고하고, 측정으로 평가가 느리다는 것이 드러날 때만 바꿉니다.

컴파일 시간도 다루나요?

아니요. 컴파일과 대상 시간은 빌드 진단 스킬이 다룹니다.

상세 정보

작성자의 원본 설명

Guide for diagnosing and improving MSBuild project evaluation performance. 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: compi

repo: dotnet/skills

인기도

GitHub 스타
5.8k
순위
#14599
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬