Simplified graph visualisation

The whole idea of Blackfire is to let you find easily where in your code you face bottlenecks or bad practices in performance management. We just released an other iteration of our call graph views to make it even simpler to read and understand.

By Christophe Dujarric, on Feb 22, 2018

Showing your code’s behavior in full details with reduced noise

The Blackfire call graph is an amazing way to discover exactly how your PHP code behaves. It show you the caller/callee relationship between function/method calls. It shows you how many times they called another, or were called by another. This critical information can support you in finding better code patterns, so that in the end, besides having higher performance, your code is leaner.

But showing you everything in the same view is never a good idea. Since the beginning, Blackfire is already cleaning up your profile views by not showing nodes which are responsible for less than 1% of the overall resources consumption (they’re probably not the ones requiring an optimization). Of course, those nodes can be seen by clicking on the magnifying glass icon.

However some code patterns and some frameworks make an extensive use of single caller and single callee relationships, resulting in very long call graph paths. Showing separate nodes, in such situations, would make our call graph view far too complex to analyze.

Proxy nodes

To a larger extent, we can define a category of nodes as “proxy” nodes. Those nodes are less significant as they’re just used to call in heavier/more relevant business logic. Showing them separately is making noise. Let’s look at two examples, on Laravel and Magento 1.

Laravel profile, before

 

Magento 1 profile, before

 

Reducing noise even more

In order to simplify the call graph view, we decided to group together adjacent proxy nodes. There is no loss of information, as all of them will always be available in the functions/methods list, as well as in a clustered node on the graph, containing all adjacent proxy nodes, plus the initial caller.

Before and after on a Symfony app

Our examples on Laravel and Magento apps

This significantly improved the visualisation for  our examples on Laravel and Magento. How is that working for your code? Let us know on Twitter @blackfireio.

Laravel profile, after

Magento 1 profile, after

Happy profiling,

Christophe Dujarric

Christophe is the Product guy at Blackfire. He has been working in several start-up companies, helping them to make and sell products out of technologies. He’s involved in every step of the product’s lifecycle, from strategy to design and sales, and loves to coach on product management methods.