Skip to main content

Chrome DevTools Performance Panel Guide

The Chrome DevTools Performance panel is the most powerful tool for diagnosing JavaScript performance issues, layout thrashing, long tasks, and Core Web Vitals regressions directly in your browser.

✓ Recording profiles ✓ Flame chart reading ✓ Long task detection ✓ Forced reflow diagnosis

Recording a Performance Profile

Reading the Flame Chart

Lane What It Shows Look For
CPUTotal CPU usage by typeYellow (scripting) spikes
NetworkResource requests timelineLong chains, render-blockers
Main ThreadJS execution call stackRed triangles = long tasks
TimingsFCP, LCP, CLS, INP markersLCP timing and its cause
CompositorGPU compositing workPaint storms

Diagnosing Long Tasks

// Mark custom tasks for DevTools visibility
performance.mark('process-start');
processLargeDataSet(data);
performance.mark('process-end');
performance.measure('Process Data', 'process-start', 'process-end');

// Break up long tasks with scheduler.yield()
async function processInChunks(items) {
  for (let i = 0; i < items.length; i++) {
    process(items[i]);
    // Yield every 50 items to avoid blocking
    if (i % 50 === 0) {
      await scheduler.yield();
      // Falls back to: await new Promise(r => setTimeout(r, 0))
    }
  }
}

Detecting Forced Reflow (Layout Thrashing)

// ❌ BAD: Read-write interleaving causes forced reflow
function badLoop(elements) {
  elements.forEach(el => {
    const width = el.offsetWidth;     // READ: forces layout
    el.style.width = width * 2 + 'px'; // WRITE: invalidates layout
    // Next read will force layout again!
  });
}

// ✅ GOOD: Batch reads, then writes
function goodLoop(elements) {
  // Phase 1: read all layout values
  const widths = elements.map(el => el.offsetWidth);
  // Phase 2: write all styles
  elements.forEach((el, i) => {
    el.style.width = widths[i] * 2 + 'px';
  });
}

// Layout-triggering properties to avoid in loops:
// offsetWidth, offsetHeight, offsetTop, offsetLeft
// scrollWidth, scrollHeight, scrollTop
// clientWidth, clientHeight, clientTop
// getBoundingClientRect(), getComputedStyle()

Bottom-Up & Call Tree Analysis

Frequently Asked Questions

How do I record a Performance profile in Chrome DevTools?▼

Open DevTools (F12), go to the Performance tab, click the Record button (circle), interact with your page or wait for the page to load, then click Stop. For load profiling, use the reload button (circle with arrow) to capture the full page load from navigation. Use Incognito mode and disable extensions to reduce noise. Set CPU throttling to 4x or 6x to simulate mobile devices.

What is a long task and how do I find it in the Performance panel?▼

A long task is any JavaScript execution that blocks the main thread for more than 50ms. They appear as red-corner triangles on Tasks in the Main thread lane. Click on a long task to see its call stack in the Bottom-Up and Call Tree tabs. Common causes: heavy event handlers, synchronous layout/style recalculation (forced reflow), unoptimized loops processing large data sets, and third-party scripts.

What is forced reflow and how do I avoid it?▼

Forced reflow (layout thrashing) occurs when JavaScript reads layout properties (offsetWidth, getBoundingClientRect, scrollTop) after making DOM changes, forcing the browser to synchronously recalculate layout. It appears as a red 'Layout' warning in the Performance panel. Fix by batching DOM reads before writes, using `requestAnimationFrame` for visual updates, or using CSS transforms/opacity instead of layout-triggering properties.

How do I use the Performance Insights panel vs the Performance panel?▼

The Performance Insights panel (newer) provides actionable insights with specific fix suggestions, automatically highlighting Core Web Vitals (LCP, CLS, INP), long tasks, and render-blocking resources with direct explanations. The Performance panel provides the raw flame chart for deep call-stack analysis. For initial diagnosis, use Performance Insights. For pinpointing the exact function causing a bottleneck, switch to the full Performance panel.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Related Articles

Apr 2, 2026 · 25 min read

Performance Optimization 2026: Complete Guide to Frontend, Backend, and Infrastructure

Comprehensive performance optimization guide for 2026 covering Core Web Vitals, JavaScript bundle optimization, server-side rendering, caching strategies, database query optimization, CDN configuration, and real-world benchmarks.

Mar 21, 2026 · 14 min read

Chrome DevTools JavaScript Debugging: Complete Guide (2026)

Master JavaScript debugging in Chrome DevTools. Learn breakpoints, the Call Stack, watch expressions, network inspection, and performance profiling with practical examples.

Apr 2, 2026 · 13 min read

Performance Testing in 2026: Beyond Page Load Times

A practical guide to performance testing in 2026 — Core Web Vitals, load testing, stress testing, soak testing, and building a performance culture that treats speed as a feature. Includes tooling recommendations and actionable measurement strategies.

Apr 2, 2026 · 14 min read

React Hooks Deep Dive: useEffect, useMemo, useCallback Performance Guide

Complete guide to React hooks performance in 2025. Master useEffect lifecycle patterns, useMemo vs useCallback differences, and when each hook helps or hurts performance.

Apr 2, 2026 · 20 min read

Rust and WebAssembly in 2026: From Zero to Production

Learn how to compile Rust code to WebAssembly for blazing-fast web applications. A complete guide covering wasm-pack, wasm-bindgen, web-sys, JavaScript integration, performance optimization, and real-world case studies from Figma, Google Earth, and more.

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →