Skip to content

Adjust ngen priorities for VS - #12559

Merged
MichalPavlik merged 2 commits into
dotnet:mainfrom
AlexDelepine:patch-2
Sep 24, 2025
Merged

MichalPavlik merged 2 commits into
dotnet:mainfrom
AlexDelepine:patch-2

Conversation

@AlexDelepine

Copy link
Copy Markdown
Contributor

Updated Ngen Priorities for VS - we're updating ngen's pri 1 list to only include the 30 assemblies with highest JIT time during VS startup. We currently do not ngen pri 1's separately, so changing assemblies to pri 2 will not affect when these get ngen'ed relative to how things are right now.

Copilot AI review requested due to automatic review settings September 22, 2025 18:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adjusts the native image generation (ngen) priorities for MSBuild assemblies in the Visual Studio setup to optimize VS startup performance. The change downgrades most assemblies from priority 1 to priority 2, keeping only the highest JIT-time assemblies at priority 1.

  • Downgrades 13 MSBuild-related assemblies from ngen priority 1 to priority 2
  • Maintains priority 1 for MSBuild.exe and the most critical assemblies (System.Text.Json.dll, System.Collections.Immutable.dll)
  • Optimizes VS startup time by focusing priority 1 ngen on the 30 assemblies with highest JIT overhead

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hello @@AlexDelepine, I noticed that you’re changing an .swr file or any file under src/Package/MSBuild.VSSetup.. Please make sure to validate this change by an experimental VS insertion. This is accomplished by pushing to an exp/* branch, which requires write permissions to this repo.

@rainersigwald rainersigwald left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM but a couple of questions.

Comment thread src/Package/MSBuild.VSSetup/files.swr Outdated
Comment thread src/Package/MSBuild.VSSetup/files.swr Outdated
@AlexDelepine

Copy link
Copy Markdown
Contributor Author

Just a heads up - the insertion will have perf regressions related to ngen priority 2, these can be ignored as my team is expecting these regressions and we will not file bugs on this.

@MichalPavlik
MichalPavlik merged commit cfc92dc into dotnet:main Sep 24, 2025
9 checks passed
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.

4 participants