During Solution Explorer search, traces show a lot of allocations related to ProjectTreeFlags:
We use project tree flags in the dependencies node to identify different types of nodes. For attached nodes, we need to obtain these flags for a given IVsHiearchy item. We do this via the VSHPROPID_ProjectTreeCapabilities property.
This innocent property read actually does a bunch of work:
Convert bits and a hash set into a long string of space-separated-values.
Convert this to BSTR
Convert this to a new managed string
If we could instead access the ProjectTreeFlags of CPS's IProjectTree item directly, we could avoid this and allocation marshalling across COM native/managed boundaries.
Reported via email from @ToddGrun and @lifengl.
During Solution Explorer search, traces show a lot of allocations related to![image](https://github.com/dotnet/project-system/assets/350947/32000081-a465-41b1-9d8a-74340c8545d9)
ProjectTreeFlags
:We use project tree flags in the dependencies node to identify different types of nodes. For attached nodes, we need to obtain these flags for a given
IVsHiearchy
item. We do this via theVSHPROPID_ProjectTreeCapabilities
property.This innocent property read actually does a bunch of work:
If we could instead access the
ProjectTreeFlags
of CPS'sIProjectTree
item directly, we could avoid this and allocation marshalling across COM native/managed boundaries.