DEV Community

Weather Clock Dash
Weather Clock Dash

Posted on

Using Firefox DevTools to Profile Web Performance (Practical Guide)

Firefox DevTools has solid performance tools. Here's how to use them to actually find and fix performance issues — not just read waterfall charts.

Opening the Performance Tools

F12 → Performance tab (or Ctrl+Shift+I → Performance)

The main tools:

  • Performance — full JavaScript + rendering profiler
  • Network — request timing and waterfall
  • Memory — heap snapshots, memory growth tracking
  • Responsive Design Mode — test with network throttling

The Network Waterfall: Reading It

Open DevTools → Network. Reload the page.

Each row is a request. The colored bar shows timing:

  • Gray — DNS lookup
  • Orange — connecting
  • Green — waiting (TTFB - Time to First Byte)
  • Blue — downloading

What to look for:

  1. Long green bars (TTFB) — server is slow to respond. Not a frontend problem — look at server-side.
  2. Many sequential requests — resources loading one after another instead of in parallel. Usually caused by render-blocking scripts.
  3. Large files — look at the Size column. Large JS bundles, unoptimized images.
  4. Blocking requests — scripts loaded in the document without async/defer block rendering.

Simulating Slow Connections

In the Network panel: throttling dropdown (usually set to "No throttling").

Options: Fast 3G, Slow 3G, Offline.

Useful for:

  • Testing how your site feels on mobile networks
  • Finding critical-path resources that cause perceptible delay

Right-click a request → "Block URL" to test what happens when a specific resource fails to load.

The Performance Profiler

For JavaScript performance analysis:

  1. DevTools → Performance → click record (circle icon)
  2. Do the action you want to profile (click a button, scroll, etc.)
  3. Click stop
  4. Analyze the flame chart

Flame chart reading: Each horizontal bar is a function call. Width = time spent. Taller stacks = deeper call chains. Find the widest bars — those are where time is spent.

The "Call Tree" view: Shows a tree of function calls with time percentages. Sort by "Self Time" to find functions that are slow themselves (not just slow because they call other slow things).

"Main Thread" timeline: Shows where JavaScript runs, layout/paint happens, and idle time. Long "yellow" blocks (Scripting) indicate JavaScript bottlenecks. Long "purple" blocks (Rendering) indicate layout/paint issues.

Memory Profiling

DevTools → Memory tab.

Heap Snapshot: Captures current memory usage. Useful for finding memory leaks — take a snapshot before and after an action, compare what grew.

How to use for leak detection:

  1. Take snapshot A (baseline)
  2. Perform the action multiple times (navigate, open/close modal, etc.)
  3. Take snapshot B
  4. Switch to Comparison mode — shows what objects grew

If you see detached DOM nodes growing, that's a common leak pattern — elements removed from the DOM but still referenced in JavaScript.

Allocation Recording: Records memory allocations over time. Identifies which function calls allocate the most memory.

Responsive Design Mode + Performance

Ctrl+Shift+M → enable responsive mode → select a mobile device preset.

Combine with network throttling for realistic mobile simulation. Firefox's responsive mode includes:

  • Touch event simulation
  • Network throttling
  • Device dimensions

For a realistic mobile performance test: select a mid-range Android device preset, enable Slow 3G throttling, then run a performance recording.

The Web Console for Performance

Quick performance checks without the full profiler:

// Basic timer
console.time('myOperation');
// ... do stuff
console.timeEnd('myOperation');

// Mark a point in the profiler timeline
performance.mark('startFetch');
// ... do stuff
performance.mark('endFetch');
performance.measure('fetchTime', 'startFetch', 'endFetch');
console.log(performance.getEntriesByName('fetchTime'));

// Get Core Web Vitals approximation
const observer = new PerformanceObserver((list) => {
  for (const entry of list.getEntries()) {
    console.log(entry.name, entry.startTime);
  }
});
observer.observe({ entryTypes: ['largest-contentful-paint', 'layout-shift'] });
Enter fullscreen mode Exit fullscreen mode

Accessibility Performance

DevTools → Accessibility panel → "Check for issues" button.

Accessibility violations: color contrast, missing ARIA labels, focusable elements. Not strictly "performance" but critical for usability.

The Tab-Based Context

When profiling complex apps, having too many other tabs open can affect your measurements (shared browser resources). For clean profiling:

Tab Manager & Session Saver is useful here: save your current tabs as a session, close everything except the page you're profiling, do your analysis, then restore the saved session.

This gives you a cleaner measurement environment and is faster than manually reopening tabs after profiling.


The most actionable things from this toolset: network panel for resource loading issues, flame chart for JS bottlenecks, heap snapshots for memory leaks. Start with the network waterfall — most web performance issues are visible there before reaching the profiler.

Top comments (0)