My sample app looks as follows.
class Program
{
static List<XmlNode> memList = new List<XmlNode>();
static void Main(string[] args)
{
Console.WriteLine("Press any key to start");
Console.ReadKey();
CauseHighCPU();
}
static public void CauseHighCPU()
{
string str = string.Empty;
for (int i = 0; i < 100000; i++)
{
str += " Hello World";
}
}
}
I expect string concatenation to cause high cpu. When I profile the application using PerfView, this is very loud and clear.
I am trying to do similar analysis using Visual Studio 2017 Diagnostics Hub. Below is what its CPU usage tab shows.
Its Call-tree view not showing any call to Concat, although, there are some External Code here
This makes me think that it may related to something missing in my configration. As you can see here, Enable Just My Code is unchecked.
Also not sure if its related but here is symbols settings.
Any thouhts what could be wrong that is causing VS not showing root cause of high-cpu usage.