Skip to content

Perf: potential lock contention in ProjectRootElementCache.Get #3039

@lifengl

Description

@lifengl

When we look into performance traces of parallel project loading work, we noticed some lock contentions in ProjectRootElementCache.Get method. In one trace we noticed it was blocked 60ms.

The code is using a single lock to control to access the cache, and also read file into XmlDocument, when it does not exist. The later one can be slow on a slow disk. When PPL is enabled, multiple projects are evaluated, and this becomes more a problem.

If the code can pull out the logic to load a project file out of the lock region, it will allow other threads to access the cache for other files in the same project collection.

Metadata

Metadata

Assignees

Labels

Area: PerformanceCPSIssues impacting CPSPriority:1Work that is critical for the release, but we could probably ship withoutbacklogtriaged

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions