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 a Performance Profile
- Open Chrome DevTools → Performance tab (F12 → Performance)
- Use Incognito mode to disable extensions and reduce noise
- Set CPU throttling: 4x slowdown for mid-range mobile, 6x for low-end
- Set Network throttling: Fast 3G for realistic conditions
- Load profile: Click the reload+record button (↺) to capture full navigation
- Interaction profile: Press Record → interact → Stop (3–5 seconds is enough)
- Check Screenshots to correlate visual changes with timeline events
Reading the Flame Chart
| Lane | What It Shows | Look For |
|---|---|---|
| CPU | Total CPU usage by type | Yellow (scripting) spikes |
| Network | Resource requests timeline | Long chains, render-blockers |
| Main Thread | JS execution call stack | Red triangles = long tasks |
| Timings | FCP, LCP, CLS, INP markers | LCP timing and its cause |
| Compositor | GPU compositing work | Paint 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
- Bottom-Up tab: Shows which functions took the most self-time (execution within the function itself). Best for finding the specific hot function.
- Call Tree tab: Shows the full call hierarchy from root to leaf. Best for understanding what triggered the expensive function.
- Event Log tab: Flat list of all events sorted by time. Filter by type (Script, Render, Paint).
- Click Group by URL in Bottom-Up to identify third-party scripts by domain.
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.
Related Products
on GumroadAI Prompt Engineering Toolkit
58 structured prompt templates for Claude, ChatGPT, and Gemini — organized by use case. Code Review, Debugging, Documentation, Architecture, and 10 model-specific tips. Stop writing prompts from scratch.
Buy on Gumroad →AI Developer Prompts Pack
55 battle-tested prompt templates for the workflows developers actually use: code review, debugging, architecture, documentation, and testing. Stop writing prompts from scratch.
Buy on Gumroad →TypeScript Quick Reference Toolkit
5 practical reference files for TypeScript developers: cheatsheet, TS vs JS comparison, 20 utility types with real examples, tsconfig best practices template, and 15 common mistakes guide. Print it. Keep it on your desk.
Buy on Gumroad →You Might Also Need
Web Performance Checklist
Interactive web performance checklist covering images, fonts, JavaScript, CSS, caching, and server. Check off items to track your score out of 100 and export as Markdown.
Open free tool →
JS Prototype Chain Visualizer
Explore JavaScript prototype chains interactively. Visualize built-in types (Array, Map, Promise, Error) and custom classes with property lookup path diagrams.
Open free tool →
JavaScript Formatter & Minifier
Format and beautify JavaScript code with proper indentation, or minify it to reduce bundle size. Handles strings, template literals, comments, and nested blocks. Runs in your browser.
Open free tool →
More Free Tools
Related Articles
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.
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.
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.
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.
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.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$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.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →