DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk5 min

How to Use Puppeteer Tracing to Debug Slow Pages

Learn how to record a Puppeteer trace around a slow page load or interaction, analyze it in Chrome DevTools, and turn costly browser activity into a testable debugging lead.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use Puppeteer tracing to record the browser work around a repeatable slow page load or interaction, then inspect the trace in Chrome DevTools’ Performance panel. Start tracing before the relevant navigation or action, stop as soon as the interval is captured, and use the trace to form a testable hypothesis—not as a standalone measure of real-user speed.

Choose the right recording: page load or runtime

First pin down when the slowness happens. If it occurs while navigating and loading the page, capture a load recording. If the page is already open and a click, typing, scrolling, or other behavior is slow, capture the runtime interval caused by that interaction. Chrome DevTools distinguishes these recording types and recommends recording an issue that you can reproduce consistently: Performance recording guidance.

As an Amazon Associate I earn from qualifying purchases.

Keep the URL, browser conditions, test data, and sequence of actions as consistent as practical between recordings. A repeatable capture makes it easier to tell whether a code change affected the work visible in the trace.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Capture a trace with Puppeteer

The core API is page.tracing.start() followed by page.tracing.stop(). Start immediately before the navigation or interaction you want to inspect, then stop after the relevant interval. Puppeteer’s tracing example uses this start, navigate, stop pattern: Tracing class.

Runnable navigation example

Save this as trace-page.js in a project with Puppeteer installed, then run node trace-page.js. It writes the browser trace to trace.json in the current directory.

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  try {
    const page = await browser.newPage();

    await page.tracing.start({ path: 'trace.json' });
    await page.goto('https://example.com', { waitUntil: 'load' });
    await page.tracing.stop();
  } finally {
    await browser.close();
  }
})();

For an interaction issue, load the page before starting the trace so the capture focuses on runtime work:

Rank #2
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option
await page.goto('https://example.com', { waitUntil: 'load' });

await page.tracing.start({ path: 'interaction-trace.json' });
await page.click('#slow-control');
await page.tracing.stop();

Replace #slow-control with a selector for the action you are investigating. If the behavior requires several steps, keep only the relevant steps between start and stop; an unnecessarily long capture can make the interval harder to inspect.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Tracing options

Puppeteer documents these tracing options in its TracingOptions interface:

  • path writes the trace to a file. If you omit it, tracing.stop() can return the trace as a Uint8Array instead.
  • categories controls which trace categories are included; prefix a category with - to exclude it. Leave categories at their defaults unless you have a reason to narrow or expand the recording.
  • screenshots controls screenshot capture and defaults to false.
  • bufferSize configures the trace buffer. Puppeteer documents a default of 200 MB (200,000 KB) when the option is omitted or set to zero; this is a buffer setting, not a performance benchmark.

Only one trace can be active at a time per browser, so do not start overlapping traces on pages in the same browser instance.

Open and read the trace in Chrome DevTools

  1. Open Chrome DevTools and select the Performance panel.
  2. Open the saved trace.json trace in the panel. Chrome documents saving and sharing trace files in its trace guide.
  3. Zoom into the interval where the slowness occurred. Inspect main-thread activity and relevant performance markers around the navigation or interaction.
  4. Use the analysis view that answers your question: Call tree for root activities with substantial work, Bottom-up for activities that consume time directly, or Event log to follow events in sequence.
  5. Compare Self Time with Total Time for an activity. Self Time is work performed directly in that activity; Total Time includes its children. A large Total Time alongside smaller Self Time points you toward work in descendants, while high Self Time makes the activity itself a stronger lead.

Chrome describes these Performance panel views and timing fields in its Performance features reference.

Rank #4
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • Brand: Wiley
  • Set of 2 Volumes
  • A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers

Which view should you use?

View Best for What to look for
Call tree Finding root activities associated with substantial work Expand a costly parent activity to see the work beneath it.
Bottom-up Finding direct time sinks Look for activities with substantial Self Time.
Event log Understanding sequence Follow event order through the recorded interval.

These are different ways to examine the same recording, not competing tracing tools. Use more than one view when you need both a likely source and the order in which the browser reached it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Turn a trace into a useful diagnosis

A trace shows where recorded time went; it does not, by itself, prove the underlying cause or establish representative real-user performance. Treat a costly activity as a diagnostic lead. Form a specific hypothesis, change one likely cause, and record again under the same conditions. If the activity or interval changes as expected, that strengthens the hypothesis; if not, inspect another part of the trace.

Keep trace duration separate from a clean speed measurement. Tracing instruments browser work, and Chrome warns that advanced paint instrumentation is slow and significantly hinders performance. Do not use a heavily instrumented trace as an end-user timing result: Chrome Performance features reference.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common problems and fixes

  • The trace file is missing or empty: Confirm that page.tracing.start() completed before the work and that page.tracing.stop() ran afterward. Check that the process can write to the directory named by path.
  • The capture contains the wrong activity: For a runtime issue, finish navigation before starting the trace. For a load issue, start tracing before navigation. Keep the capture interval tightly focused on the work of interest.
  • Puppeteer reports that tracing is already active: A browser can have only one active trace at a time. Stop the active trace before starting another.
  • The event of interest is difficult to find: Reproduce the issue consistently, narrow the capture window, and zoom into that interval in the Performance panel. Use Event log to establish sequence, then Call tree or Bottom-up to inspect work.
  • The trace seems to slow the page: Remember that tracing adds instrumentation. Avoid advanced paint instrumentation unless you specifically need it, and do not treat trace timing as a representative user speed result.

Handle trace files as sensitive data

Review a trace before sharing it. Chrome says exported traces can include script content and source maps; in some circumstances, user-specific script content injected by a server could contain secrets. Puppeteer also warns that protocol logs may include sensitive information. Share diagnostic artifacts only with people who should see their contents: Puppeteer debugging guidance and Chrome trace sharing guidance.

Or skip the browser setup

If you need a screenshot rather than a browser performance trace, ScreenshotNeo provides a one-call screenshot API. It is not a substitute for Puppeteer tracing or DevTools’ timing analysis.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

See the ScreenshotNeo API documentation for request options.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before the screenshot; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. The service is at ScreenshotNeo.

Sign up for 1,000 free screenshots a month—no card required.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.