

Trying to fine-tune/optimize my C# application. Been running PerfMon and I consistently get a spike of 100% on some operations. I can get the thread instance number from PerfMon but from Visual Studio 2015's thread window when debugging, how do I know which thread is the corresponding one?
Or am I going about it the wrong way? I want to find out the identity of the thread that's spiking in CPU usage from time to time. Thanks in advance SO!
For this I would use Process Explorer. The process properties (double click on a process to open) has a threads tab. This can be sorted by CPU or cycles, and has a button to snapshot the thread stack.
It will also make use of debug symbols to resolve the content of that stack.
This makes it much easier to identify what code a thread is running.
Another option would be PerfView from the Windows Debugging Tools: which gives even more data (but has a steeper learning curve).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With