You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The on disk cache is not adding any value in the hot scenario because its contents already lives in the in-memory cache. The proposal is to load it lazily only when (and if) RAR runs into an assembly that does not have a record in the in-memory cache. In developer inner loop, when the same solution is built over and over again, the cache would typically not be loaded at all, unless the developer makes a change that actually changes the dependency graph.
The text was updated successfully, but these errors were encountered:
Contributes to #8635
Context
With #8688 we no longer need to cache data on immutable framework files on disk as obtaining this information is cheap and does not require I/O.
Changes Made
Made SystemState (the RAR cache) not add such files to the per-instance dictionary. This dictionary is serialized to disk as <project-file>.AssemblyReference.cache so the change effectively makes the cache file smaller, saving on serialization and deserialization time.
Also refactored DeserializeCache into a generic method instead of taking a Type parameter.
For a simple ASP.NET Core app with one project reference and one package reference, the size of the cache file is reduced from 142 kB to 2 kB. Projects with no references other than the SDK will not have the cache file created at all.
Testing
Existing unit tests, manual measurements.
Notes
The actual "Don't read the file if the data is already in memory" change will be in a separate upcoming PR.
This issue tracks implementing the optimization per https://github.com/dotnet/msbuild/blob/main/documentation/specs/rar-core-scenarios.md#dont-load-the-per-project-disk-cache-when-not-needed
Parent user story: #8422
The on disk cache is not adding any value in the hot scenario because its contents already lives in the in-memory cache. The proposal is to load it lazily only when (and if) RAR runs into an assembly that does not have a record in the in-memory cache. In developer inner loop, when the same solution is built over and over again, the cache would typically not be loaded at all, unless the developer makes a change that actually changes the dependency graph.
The text was updated successfully, but these errors were encountered: