-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Don't run ResolveAssemblyReference if there are no conflicts in the project.assets.json #1193
Comments
This is related to dotnet/msbuild#2015. |
Related: https://github.com/dotnet/cli/issues/5918 |
I don't think I understand the request here. RAR is the way |
The theory is that RAR only needs to be run to resolve dll conflicts as nuget already figures out package conflicts. After thinking about this a bit, it may not work as cleanly as I expected because we now embed the same dlls in Microsoft.NETCore.App and NETStandard.Library so there might always be conflicts in 2.0 applications. The goal to was to figure out ways to elide calling RAR altogether. |
The other suggestion made was to pass all the ASP.NET Core assemblies as "Framework Assemblies" to RAR, as that might result in it processing them less (or not at all). Do we have any more information on that option? |
ping |
These conflicts are handled outside of RAR in the SDK. We have https://github.com/dotnet/sdk/tree/master/src/Tasks/Microsoft.NET.Build.Tasks/ConflictResolution that handles these conflicts. /cc @ericstj @dsplaisted |
RAR is less about conflicts and more about resolving paths. In fact, RAR doesn't even handle conflicting primary references, it just passes them along. We'd probably want to profile RAR to find out what's taking so much time. I bet there is some opportunity to back things with a cache. I suspect that every time a project builds it reloads the assemblies from the nuget package folder and examines metadata and references. Since packages are immutable it could cache this. Bypassing RAR for things that are already resolved to a path is doable and would definitely help, but we'd want to make sure all metadata is set correctly on ReferencePaths items. It does things like examine WinMDs and preserves assembly metadata. We'd also not want to do that for desktop since RAR is responsible for finding conflicts and feeding bindingRedirects into app.config. I think this issue belongs in the MSBuild repo, not SDK. |
Yeah, I don't think this is distinct from dotnet/msbuild#2015. We can't just skip RAR for the reasons @ericstj points out: that's the only way the items that get fed to the compiler get populated. |
@kieranmo mentioned to me that it might be possible to pass more data to RAR in order for it to treat the ASP.NET Core assemblies like FX assemblies, which means don't delve into them for dependencies. Does anyone know if it's possible for us to hack that up now to see if it helps? e.g. can we create an items list during build or something? |
I'm going to close this in lieu of dotnet/msbuild#2015 |
…104.1 (dotnet#1193) - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20054.1
In a new ASP.NET Core 2.0 application,
dotnet build
is slower than in an ASP.NET Core 1.x application. This is primarily due to the new meta-packageMicrosoft.AspNetCore.All
that brings in the entire product graph (~180 assemblies) causingResolveAssemblyReference
(RAR) to take a long time (5-7 seconds on my cold very powerful, dev machine, still greater than 1 second after warm-up), which accounts for the vast majority of the build time.Can we detect when running RAR is unnecessary, based on if no assembly name appears more than once in the
project.assets.json
file? Even better if this is determined during restore, so that it doesn't need to be calculated during build at all.This combined with the upcoming no-op
dotnet restore
performance work incoming for preview2, would get build times down for simple .cs file changes to just 100's of milliseconds (assuming we can avoid the lock file and package related tasks and targets profiled below).Result of warmed up
dotnet build
execution on ASP.NET Core 2.0-preview1 project@davidfowl @livarcocc @JunTaoLuo
The text was updated successfully, but these errors were encountered: