CPU insights is a sub-feature of the CPU Usage tool that shows common potential latency issues like concatenating strings inefficiently.
View Auto Insights
The Top Insights section in the CPU Usage tool shows quick CPU details, insights, and suggestions in the description so that you can continue diagnosing the issue. The Learn more link shows you in-depth documentation that explains your issue. If you need more information, View source code shows more details. Once selected, you can see the call tree view, showing the process, functions, and which callers use the most CPU.
View top functions
On the summary page under Top Functions, you can find the top functions called with the time spent in descending order. Total CPU time is the amount of time spent inside a function, including any functions it calls, whereas Self CPU is time spent exclusively in the function.
View the hot path
Hot Path shows where most of the CPU time was being spent in your application and helps focus investigation on the area that would have the most impact. Analyzing this code path by using other tools in the Performance Profiler can help identify ways to improve the code as well. For example, it may help identify how to minimize allocations on the hot path to reduce GC frequency and time spent in GC.
Get AI assistance
If you have Copilot, you can get AI assistance while you're looking at CPU Auto Insights. Copilot provides information and insights related to a set of specific performance insights. With Copilot, you can also ask questions about functions on the identified hot paths in your code, which can help you produce more efficient or cost-effective code.
The Ask Copilot button Screenshot of Ask Copilot button. appears even if no specific performance insights are identified. Select Ask Copilot to learn from Copilot and start asking questions.
Find hot paths in your code by using a Flame Graph for a visual overview of where time is spent in an application and view deeper data for specific nodes.
Learn how the Performance Profiler and Diagnostic Tools window in Visual Studio have many different settings that affect the overall performance of the tools.
Learn about the CPU profiler performance tool, which shows the CPU time and percentage spent executing code in C++, C#, Visual Basic, and JavaScript apps.
Learn how the Performance Profiler was designed with the idea that multiple tools can be used in the same session to aid in understanding performance issues.
Explore documentation to help you use profiling tools in Visual Studio to measure performance, including overviews, getting started tutorials, and how-to guides.