This issue tracks implementing the optimization per https://github.com/dotnet/msbuild/blob/main/documentation/design/rar-core-scenarios.md#obtain-assembly-names-from-the-sdk
Parent user story: #8422
The SDK is currently already passing relevant metadata such as AssemblyVersion and PublicKeyToken, so there is no need for RAR to open the file and parse its .NET metadata tables to get this information. This, together with the fact that SDK references are marked with ExternallyResolved so they cannot have dependencies outside of the primary set, means that there is no need to cache anything about these assemblies. Everything RAR needs comes (or can come if it's not there already) from the Assemblies parameter, explicitly provided on each invocation. Note, it may make sense to keep a cache in memory but it definitely doesn't make sense to save it to disk.
If we do this, then in the warm and hot scenarios where the per project disk cache exists, we use it only to cache data about NuGet references and project references, significantly reducing its size. By eliminating per-reference I/O for most references, RAR would see a significant performance boost.
This issue tracks implementing the optimization per https://github.com/dotnet/msbuild/blob/main/documentation/design/rar-core-scenarios.md#obtain-assembly-names-from-the-sdk
Parent user story: #8422
The SDK is currently already passing relevant metadata such as
AssemblyVersionandPublicKeyToken, so there is no need for RAR to open the file and parse its .NET metadata tables to get this information. This, together with the fact that SDK references are marked withExternallyResolvedso they cannot have dependencies outside of the primary set, means that there is no need to cache anything about these assemblies. Everything RAR needs comes (or can come if it's not there already) from theAssembliesparameter, explicitly provided on each invocation. Note, it may make sense to keep a cache in memory but it definitely doesn't make sense to save it to disk.If we do this, then in the warm and hot scenarios where the per project disk cache exists, we use it only to cache data about NuGet references and project references, significantly reducing its size. By eliminating per-reference I/O for most references, RAR would see a significant performance boost.