dotnet / dotnet/msbuild

Improve ProjectRootElementCache caching strategy

Open
#1,068 2 comments 0 reactions 0 assignees View on GitHub
Area: Performance backlog Priority:1 triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

`ProjectRootElementCache.DiscardImplicitReferences` is always called (directly or indirectly) from `BuildManager.BeginBuild`. The implicit references will be all the `.props` and `.targets` files imported by a project. These should be the project files that are most likely to be shared between different projects, so it seems counterproductive to force them to be ejected from the cache for each build.

With the Chromium solution (which has ~3500 projects), disabling the calls to `DiscardImplicitReferences` improved the time until Visual Studio finished initializing the projects from 18 minutes to 13.5 minutes on the PC I was using to test it.

While this is a great improvement, we need to understand if there is a good reason that the implicit references are being discarded, or if keeping them is likely to negatively impact other scenarios.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.