dotnet / dotnet/project-system

Inefficient way to create the first version of the dependencies tree after loading a project

Open
#3,321 6 comments 0 reactions 1 assignee Claimed by @drewnoakes View on GitHub
Feature-Dependency-Node Performance-Scenario-Solution-Open Priority:2 Tenet-Performance Triage-Approved
Dominant language
C#
Stars
1k
Forks
415
PR merge metrics
No merged PRs in 30d

Description

GroupedByTargetTreeViewProvider.BuildSubTreesAsync will create nodes by nodes and insert them to the tree. It turns out to be a very inefficient way to create the immutable tree. When the code add one item, the entire spine will need be replaced (also it remembers the each change in the history record). The main project tree in CPS has been written to create it from bottom-up. (Creating leaf nodes first then folders with existing children nodes). This will reduce lots of CPU/memory overhead. The later sequence still has to update node by node because of the limitation of the current data structure, but usually, it will do much less change after first iteration.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.