dotTrace Call Tree: Smart Navigation
Usually, when profiling applications, you have to analyze the call tree. This part of the job is the most tedious: digging through the endless sequences of nodes distracts you from focusing on real problem areas. With dotTrace smart navigation, this task becomes much easier. Let’s see how it works, using the sample application that comes bundled with dotTrace.
In order to investigate the application’s behavior and spot potential candidates for optimization you usually navigate the call tree with a mouse or arrow keys.
You are presented with the data on relative and exact timings as well as number of calls to particular methods. Percentage of time consumed by the method in relation to the thread’s root can be used here as a bottleneck signal. With the help of these concise but precise data we can find out who is the major time consumer in our case: the SetClip method.
As you can see, some calls are marked gray and sort of dimmed out in the GUI. Those are calls to filtered methods. By default, only system calls are filtered (Microsoft.*, System.*). However, dotTrace lets you apply any number of custom filters (View | Filters | Manage Filters… or Ctrl+Alt+F). This can be very helpful if you have little or no interest in investigating behavior of some functions (perhaps, because they can’t really be optimized).
To exclude filtered items completely from navigation process there is a pair of commands in the View menu which are also available through shortcuts: To Next/Previous Unfiltered Node (Ctrl+Right/Ctrl+Left) bypasses all filtered calls in the process of navigation.
Another pair of commands is To Next/Previous Important Node (Shift+Ctrl+Right/Shift+Ctrl+Left). It offers you the possibility to get from the initial ‘grouped by thread’ state right to the next method which can be of interest from practical perspective. The view becomes completely unfolded with the necessary item highlighted. All that can be done with the help of a single menu command or a handy shortcut:
When performing navigation between important nodes dotTrace goes down the call tree until it finds a node having two or more child nodes, each of which consumes at least 10 percent of the overall runtime. Selected becomes the child, which consumed the largest amount of time in comparison to other children.
Navigation between important nodes can be a tremendous timesaver, indeed!
Subscribe to Blog updates
Boost Code Quality with Qodana and GitHub Actions
It’s been roughly half a year since we introduced Qodana to .NET in our blog post about how to elevate your C# code quality with Qodana. Since then, we’ve been quite busy! Qodana went out of preview and into GA. Furthermore, we greatly improved the integration with our IDEs, providing an effortless …
Critical Thinking in an AI-Powered World
Critical thinking techniques for use with JetBrains AI Assistant.
How To Use AI Assistant to Generate Test Data For .NET Applications
How To Use AI Assistant to Generate Test Data For .NET Applications for better unit tests.