How-To's

dotTrace 2016.2 adds folding recursive calls in Timeline Viewer

Although dotTrace 2016.2 mainly focuses on performance and bug fixes, it also gets one easy-to-miss yet important new feature, which has to do with how dotTrace Timeline Viewer shows recursive calls.

Recursive call stacks can be deep and difficult to analyze. Before 2016.2, Timeline Viewer showed call stack “as is”, i.e recursive calls were simply shown as they were called — one after another in the stack trace. Of course, on complex call stacks with multiple recursive calls this resulted in almost infinite stack scrolling. Now, dotTrace 2016.2 allows you to fold such calls to simplify stack analysis.

For example, let’s take a look at the call stack of a simple application that recursively copies files from a directory and its subdirectories, and reports the progress (the example below is shown for a directory with 3 subdirectories).

This is how it looked in dotTrace Timeline Viewer 2016.1:

Recursive calls in dotTrace Timeline Viewer 2016.1

And this is how the same stack looks in dotTrace Timeline Viewer 2016.2 when recursive calls are folded:

Folded recursive calls in dotTrace Timeline Viewer 2016.2

dotTrace recalculates the tree of recursive calls (it summarizes call times in all recursive subtrees) and presents the information by function signatures. Folded recursive calls are marked with the Folded call icon.

After you unfold a call (by clicking the Folded call icon), you get the familiar stack representation when all recursive calls are shown one after another as they were called. Unfolded recursive calls are marked with the Unfolded call icon:

Unfolded recursive calls in dotTrace Timeline Viewer 2016.2

Note that you don’t necessarily need to fold the entire recursive call tree. You can also fold/unfold any part of the recursive subtree:
Folded recursive subtree in dotTrace Timeline Viewer 2016.2

We hope you find this feature helpful and that it does help you simplify the analysis of complex call trees. To try it on your own, download ReSharper Ultimate 2016.2.

image description