Performance Hands-On 15 - Call Tree Analysis

Call Tree Analysis in Performance DevTool

What is the Call Tree?

The Call Tree view in Chrome DevTools Performance panel shows the hierarchical call paths in your JavaScript code. It helps you understand:

Key Features of Call Tree:

  • Self Time: Time spent in the function itself (excluding calls to other functions)
  • Total Time: Total time including all child function calls
  • Aggregation: Similar call stacks are aggregated for easier analysis
  • Call Hierarchy: Visualizes parent-child relationships between functions

Hands-On Exercise

  1. Open the DevTools (F12 or right-click and select "Inspect")
  2. Go to the Performance tab
  3. Click the Record button
  4. Click the Run Call Tree Demo button below
  5. After the demo completes, click Stop in DevTools
  6. When the recording loads, scroll down to the Bottom-Up, Call Tree or Event Log sections

Analysis Tasks:

  1. Find which function consumes the most CPU time (look for computeHeavyTask)
  2. Identify which functions call computeHeavyTask (parent functions)
  3. Compare "Self Time" vs "Total Time" for each function
  4. Try switching between Call Tree and Bottom-Up views to see different perspectives

Call Tree Demo

This button triggers a series of function calls that demonstrate a multi-level call hierarchy. The demo includes CPU-intensive tasks, DOM manipulation, and data processing operations.

What to look for in the Call Tree: