resolve-project-references
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMisleading ResolveProjectReferences Time
容易造成误导的ResolveProjectReferences耗时
Prevent misguided optimization of by explaining that its reported time is wall-clock wait time, not CPU work.
ResolveProjectReferences通过说明上报的耗时是挂钟等待时间而非CPU工作量,避免对该目标进行错误的优化。
ResolveProjectReferencesWhen to Use
适用场景
- appears as the most expensive target in the Target Performance Summary
ResolveProjectReferences - A developer is trying to optimize directly
ResolveProjectReferences - Build performance analysis shows a single target consuming 50-80% of total build time
- 在目标性能摘要(Target Performance Summary)中显示为开销最高的目标
ResolveProjectReferences - 开发者正尝试直接优化
ResolveProjectReferences - 构建性能分析显示单个目标占用了总构建时间的50-80%
When Not to Use
不适用场景
- General build performance optimization (use instead)
build-perf-diagnostics - The bottleneck is clearly a different target (e.g., ,
Csc)ResolveAssemblyReference - The user has not yet captured a binlog or performance summary
- 通用构建性能优化(请改用)
build-perf-diagnostics - 瓶颈明显是其他目标(例如、
Csc)ResolveAssemblyReference - 用户尚未捕获binlog或性能摘要
Inputs
输入项
| Input | Required | Description |
|---|---|---|
| Build log or binlog | Yes | A diagnostic build log or binlog containing the Target Performance Summary |
| 输入项 | 必填 | 说明 |
|---|---|---|
| 构建日志或binlog | 是 | 包含目标性能摘要的诊断级构建日志或binlog |
Workflow
工作流程
Step 1: Confirm the misleading symptom
步骤1:确认误导性症状
Verify that appears as the top target in the Target Performance Summary. This is the misleading metric.
ResolveProjectReferences核实在目标性能摘要中排在首位,该指标存在误导性。
ResolveProjectReferencesStep 2: Explain why it is misleading
步骤2:解释误导性的原因
The reported time includes waiting for dependent projects to build while the MSBuild node is yielded (see dotnet/msbuild#3135). During this wait, the node may be doing useful work on other projects. The target itself does very little work.
上报的耗时包含MSBuild节点让出时等待依赖项目构建的时间(参考dotnet/msbuild#3135)。在等待期间,该节点可能在处理其他项目的有效工作,该目标本身实际执行的工作量极少。
Step 3: Redirect to task self-time
步骤3:引导关注任务自身耗时
Guide the user to use the Task Performance Summary instead:
bash
dotnet msbuild build.binlog -noconlog -fl "-flp:v=diag;logfile=full.log;performancesummary"
grep "Task Performance Summary" -A 50 full.logFocus on self-time of actual tasks:
- Csc: see skill (Section 2: Roslyn Analyzers)
build-perf-diagnostics - ResolveAssemblyReference: see skill (Section 1: RAR)
build-perf-diagnostics - Copy: see skill (Section 4: File I/O)
build-perf-diagnostics - Serialization bottlenecks: see skill
build-parallelism
引导用户转而使用任务性能摘要(Task Performance Summary):
bash
dotnet msbuild build.binlog -noconlog -fl "-flp:v=diag;logfile=full.log;performancesummary"
grep "Task Performance Summary" -A 50 full.log聚焦实际任务的自身耗时:
- Csc:参考技能(第2节:Roslyn分析器)
build-perf-diagnostics - ResolveAssemblyReference:参考技能(第1节:RAR)
build-perf-diagnostics - Copy:参考技能(第4节:文件I/O)
build-perf-diagnostics - 序列化瓶颈:参考技能
build-parallelism
Validation
校验项
- Task Performance Summary was used instead of Target Performance Summary
- was not set as the optimization target
ResolveProjectReferences - A concrete task (e.g., ,
Csc,Copy) was identified as the true bottleneckResolveAssemblyReference
- 已使用任务性能摘要替代目标性能摘要
- 未将设为优化目标
ResolveProjectReferences - 已识别出具体任务(例如、
Csc、Copy)作为真正的瓶颈ResolveAssemblyReference