Understanding Comparisons

One of the greatest features of the Blackfire profiler is the ability to display a call graph that represents the consumed resource changes (A and B) between two profiles to make it easy to find gains and losses.

The graph is a superposition of all calls from the two original graphs.

When a node is present in both profiles, it is displayed as a single node on the graph (shared nodes).

The background color tells you if the node is faster in profile B (blue) or slower (red).

The number displayed in a node is the performance gain or loss; it is the gain/loss for the node itself including all its children.

When the path between two shared nodes is different, the nodes for profile A path are displayed on the left side of the graph and on the right side for profile B (each side can be empty).

The background color and the number are not relevant.

Performance changes only make sense for shared nodes; calculating the gain or loss between two shared nodes is as simple as subtracting their numbers.

When a portion of the graph is different for profile A and B, the performance gain or loss can be calculated by subtracting the number of the first shared node before the split and the first shared node after the split.

Let's take some examples:

Comparison

On this graph, the code from the B profile is faster than the code from the A profile as the main() node displays a -341ms.

Comparison

On this graph, there is a function call that is only present on profile A. The performance improvement of this call removal is -91ms (-253ms - -162ms).