-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Load NuGet.Frameworks into secondary AppDomain (MSBuild.exe only) #9446
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good from quick point of view - but I need more detailed look (kick me if I do not add approve/request changes review by EOD Thursday)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like NuGet.Frameworks
is already in the generated devenv.exe.config
. Think it'd be possible to detect if we're in the VS process and call LoadWithPartialName
there, too?
Possible, yes. It would require adding a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no further comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this final version!
a07ff8f
to
dae3879
Compare
4a6feba
to
5021699
Compare
|
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Related to #9303
Context
We load
NuGet.Frameworks
lazily by path when the project being evaluated calls one of a few property functions that need it. All standard .NET projects use such functionality so this load is executed pretty much always. Since we're loading the assembly by path, the loader is unable to take advantage of the native image and we spend 50-100 ms JITting.Changes Made
Improved MSBuild.exe startup (or, more precisely, first evaluation) by 50-100 ms by loading
NuGet.Frameworks
into a separate AppDomain usingAssembly.Load
. The AppDomain is set up with the right binding redirects for the loader to load the assembly by strong name and use its native image.Testing
Experimental insertions.
Notes
There are several other assemblies that require non-trivial JITting on startup. The reason why we're tackling
NuGet.Frameworks
here are:Other notes:
NuGet.Frameworks
copy that lives in{VS-installation}\Common7\IDE\CommonExtensions\Microsoft\NuGet
. The MSBuild process may also load SDK-specific copies from paths likeC:\Program Files\dotnet\sdk\8.0.100\Sdks\Microsoft.NET.Sdk\tools\net472
which are out of scope here.This is what the AD looks like in SOS: