Skip to main content
Guides

Understanding Flame Graphs

Flame graphs are the most powerful way to visualize where time is spent in your application. Perfbase renders interactive flame graphs from your profiling data.

How to read a flame graph

  • Each bar represents a function call
  • Width represents time spent - wider bars = more time
  • Vertical stacking shows the call hierarchy - the function on top was called by the function below it
  • Color indicates the function category: database (blue), HTTP (green), file I/O (yellow), framework (gray), user code (default)

Interacting with flame graphs

Zoom

Click any bar to zoom into that subtree. The breadcrumb trail at the top shows your zoom path. Press Esc to reset.

Use the search bar (or press /) to highlight matching functions. The match count and percentage of total time are shown.

Min duration filter

Use the slider to hide functions below a time threshold. This is useful for focusing on the significant call paths in deep stacks.

Vendor code toggle

Toggle the “Hide vendor” button to collapse library/framework internals and focus on your application code.

Tips for finding performance issues

  1. Look for wide bars - these functions consume the most wall time
  2. Look for many narrow bars at the same level - this often indicates N+1 queries or loop-heavy code
  3. Compare flame graphs across requests - use the trace list to find slow vs fast requests for the same action
  4. Check the database layer - blue bars (PDO, MongoDB, Redis) often dominate in web applications

Export

Click the camera icon to export the flame graph as a PNG image for sharing in pull requests or incident reports.