Investigate reusing SDK resolution results across MSBuild server evaluations
- Dominant language
- C#
- Stars
- 5.5k
- Forks
- 1.5k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 141
Description
### Goal
Determine whether sharing SDK resolver results through `EvaluationContext.SharingPolicy.SharedSDKCache` meaningfully improves warm, no-op evaluations hosted by the MSBuild server, and prototype a correct invalidation strategy.
### Proposed Work
1. Identify which state is reused by `EvaluationContext` policies:
- `Isolated`
- `SharedSDKCache`
- `Shared`
2. Benchmark first and warm second evaluations under each policy:
- Measure total evaluation time.
- Measure SDK resolution elapsed time using ETW or equivalent instrumentation.
- Measure time to actual build start.
- Record SDK cache hits and misses.
3. Compare:
- `SharedSDKCache` against `Isolated` to estimate the SDK-cache benefit.
- `Shared` against `SharedSDKCache` to estimate the benefit from broader file-system, glob, and import sharing.
4. If the SDK-only benefit is meaningful, prototype caching for explicitly versioned SDK requests:
- Reuse results for equivalent requests.
- Miss when the SDK name or requested version changes.
- Confirm the resolved SDK paths and imported files remain correct.
5. Design invalidation for unversioned requests:
- Track resolver inputs such as `global.json`, resolver configuration, environment values, and installed SDK state.
- Validate recorded dependencies before reusing a cached result.
- Rerun resolution and replace the entry when a dependency changes.
- Evaluate whether SDK resolvers need an interface for reporting resolution dependencies.
### Acceptance Criteria
- The state reused by each `EvaluationContext` sharing policy is documented.
- Controlled benchmarks compare `Isolated`, `SharedSDKCache`, and `Shared`.
- ETW or equivalent evidence shows first- versus second-evaluation SDK resolution costs.
- The results establish whether SDK-only caching provides a meaningful improvement.
- An explicitly versioned SDK cache prototype demonstrates correct hits and misses.
- A design proposal covers dependency-based invalidation for unversioned requests.
- A recommendation is made to adopt `SharedSDKCache`, improve resolver-local caching, or pursue another evaluation optimization.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.