Skip to content

Comments

Make runtimeAssembliesCLR35_20 lazy#12928

Merged
YuliiaKovalova merged 3 commits intomainfrom
dev/ykovalova/add_lazy_init
Dec 12, 2025
Merged

Make runtimeAssembliesCLR35_20 lazy#12928
YuliiaKovalova merged 3 commits intomainfrom
dev/ykovalova/add_lazy_init

Conversation

@YuliiaKovalova
Copy link
Member

improvement for #12823

Copilot AI review requested due to automatic review settings December 12, 2025 14:14
@YuliiaKovalova YuliiaKovalova enabled auto-merge (squash) December 12, 2025 14:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request improves startup performance by making the runtimeAssembliesCLR35_20 field lazy-initialized, ensuring that CLR 2.0 and 3.5 assemblies are only enumerated when actually needed. This is an enhancement to PR #12823, reducing unnecessary initialization costs for NETFRAMEWORK builds.

Key changes:

  • Converts runtimeAssembliesCLR35_20 from an eagerly-initialized static field to a Lazy<string[]> for deferred initialization
  • Adds deduplication logic to prioritize CLR 3.5 assemblies over CLR 2.0 assemblies when both contain the same assembly names
  • Extracts the AddAssembliesToDictionary helper method from a local function to a private static method for reuse

@YuliiaKovalova YuliiaKovalova self-assigned this Dec 12, 2025
@YuliiaKovalova YuliiaKovalova merged commit fd4375f into main Dec 12, 2025
10 checks passed
@YuliiaKovalova YuliiaKovalova deleted the dev/ykovalova/add_lazy_init branch December 12, 2025 16:02
rainersigwald added a commit to rainersigwald/msbuild that referenced this pull request Dec 15, 2025
rainersigwald added a commit that referenced this pull request Dec 15, 2025
It's not totally clear how, but this appears to have caused perf DDRIT
failures on insertion to VS. Reverting to investigate later.

* Revert "Make runtimeAssembliesCLR35_20 lazy (#12928)"
* Revert " Fix assembly resolution for .exe files and legacy .NET
Framework tasks (CLR35 and CLR2) (#12823)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants