Course contentsShow
← Web Development
Lesson 2212 of 2,98240. Browser DevTools Deep DiveFree lesson

Reading the Timeline: Main Thread Activity

Understand the flame chart showing JavaScript execution, layout, paint, and rendering work on the main thread.

Reading the Timeline: Main Thread Activity

You'll learn how to interpret the flame chart in DevTools Performance panel to see exactly what your browser's main thread is doing during page execution.

What Is the Main Thread Timeline?

After recording a performance profile, the Performance panel shows a flame chart – a color-coded, time-based visualization of everything happening on the browser's main thread. Think of it like a medical chart showing a patient's vital signs over time, except here you're tracking your webpage's processing heartbeat.

The main thread handles JavaScript execution, layout calculations, style computations, and paint operations – all the critical work that affects user experience. When this thread is busy (or "blocked"), your page becomes unresponsive.

Reading the Flame Chart

The chart displays stacked bars representing tasks:

  • Yellow bars: JavaScript execution (function calls, script parsing)
  • Purple bars: Layout/reflow (calculating element positions and sizes)
  • Green bars: Paint operations (drawing pixels to layers)
  • Gray bars: Other browser work (garbage collection, system tasks)

The width of each bar represents duration – wider means slower. Bars stack vertically to show the call hierarchy: the top bar triggered the bars below it.

Long, solid blocks of color indicate the main thread is busy with that task. If you see a tall stack of yellow bars taking 200ms, that's JavaScript blocking the thread, preventing user interactions.

Why This Matters

Reading this timeline helps you identify performance bottlenecks. A sudden spike in purple? Your JavaScript triggered expensive layout recalculations. Continuous yellow bars during scrolling? Heavy scripts are blocking smooth rendering.

Key Takeaway: The main thread flame chart reveals exactly which tasks (JavaScript, layout, or paint) are consuming time and blocking your page from being responsive.