Folded Calls

To make callgraphs easier viewable, Tideways applies an algorithm to fold calls into each other when they seem to be part of a call chain with similar total call time.

This is mainly necessary for "lasagna code". When a child function call takes 95% or more of the time of its parent, then it is a candiate for getting folded into the parent. For example with this Laravel callgraph, where a chain of middlewares is called nested into each other:

Example folding of calls in Laravel application

The folding produces a more compact callgraph where you see the entry function with its total execution time and the "leafes" with their execution time only. Usually you are not intersted in what happens in between, so that this reduction in displayed function calls gives a clearer picture of the callgraph and what to optimize.

In the callgraph when you see folded calls, they are rendered as a text node in the graph with the amount of calls that are folded and an action to unfold them when you click.

Example: Left side has three folded calls below index.php and right side has them expanded.

In the call details panel, there is also a hint that a call has children that were folded into it.

Example: Folded calls in the call details panel.
Still need help? Email [email protected]