Skip to content

@ogygia/devtools · Dock

Page load

The dock's Page tab shows what the browser measured on this load, on your own page: rated vitals, findings that name the island at fault, and the waterfalls, main thread, files and styles behind them. The Profiler tab beside it profiles the same page's server render.

On this page

A slow page has a cause you can point at: the server took long to answer, a file held the first paint, an island hydrated in one long task, or a hole showed its skeleton for two seconds. The Page tab collects what the browser measured while the page loaded and turns it into those answers, each one named on its island.

It reads the same visit data the profiler collects from browsers, but live, on your own page. To explain what it measured, the tab asks a few things of the servers your page already loads from: a HEAD per island file and the runtime, to read their cache headers (in a build); a HEAD for a preloaded font the browser downloaded again, to read its Vary header; your own stylesheets again, from the cache, to look for unscoped CSS; and, on the dev server, Vite’s list of pre-bundled packages. (With the profiler on, the page also posts its visit to the profiler, as every measured page does.) Open the dock, press Page, and read it top to bottom: the vitals, then the findings, then the parts that explain them.

Web vitals

The top row rates the page’s five web vitals with the standard thresholds, as good, needs work or poor:

VitalGood up toPoor from
TTFB, time to the HTML’s first byte800 ms1,800 ms
FCP, the first paint1,800 ms3,000 ms
LCP, the largest paint2,500 ms4,000 ms
CLS, how much the layout moved0.10.25
INP, the slowest interaction’s response200 ms500 ms

Long tasks add up beside them. INP has no value until you interact with the page. A vital that isn’t good becomes a finding that explains it, part by part, so the next section tells you why.

On the dev server, modules load one at a time and a page compiles on its first request, so load times run high. The tab says so, and a finding caused only by that compile is marked as a note. Reload for a warm reading.

localhost:5173/shop
ogygia devtools a mock of seven of the dock's ten tabs; the numbers are made up
TTFB92 ms
FCP310 ms
LCP640 ms
CLS0.020
INP—
  • lcp-lazy the largest image is loading="lazy"; load it eagerly
  • render-blocking one stylesheet blocks the first paint for 260 ms

Findings

Findings lists what the browser measured going wrong, worst first. Each one says what happened, with numbers, and how to fix it. Each one names its islands: hover the finding to light them up on the page (while the Lens overlay is on), or click an island’s chip to open its card. When nothing looks wrong, the tab says “Nothing the browser measured looks wrong on this visit.”

Page findings lists every finding the tab can raise, what triggers it and what to do.

Island waterfall

The island waterfall has one row per island that woke, on the page’s own clock, with FCP, LCP, DOMContentLoaded and the load event marked on the axis. Each row splits into three parts:

  • module: from the island’s wake to its code being loaded;
  • waiting for its turn: islands hydrate one per task, the ones in view first, so an island whose code is in may wait behind others;
  • hydrate: the hydrate step itself, which blocks the main thread while it runs.

An island that wakes on load or idle below the first screen is marked below the fold. An island whose hydration was flagged shows recovered or markup changed. Before any island wakes, the tab says “No island has woken yet.”

Hole waterfall

The hole waterfall has one row per server island, on the same axis. Each bar is cut where the browser and the server timed it:

  • before its request left: the browser runs a few hole requests at a time (three), so a hole can wait for one to finish;
  • render slot: the wait for a render slot on the server. A server process renders four holes at a time, and a hole holds its slot while it awaits its data, so slow holes make the next ones wait;
  • server render;
  • network + swap: the answer’s download and its swap into the page.

Without the server’s timing (a browser that doesn’t measure, see below), render slot and server render show as one part, waiting on the server. When the browser has no timing for the request at all, the bar is one part, waiting for its answer.

The time on the right is how long the hole showed its fallback. A hole whose answer never came gets a red row with the reason (hole-failed). Hover a row to light up the hole, or click to open it.

The server’s two parts come from the hole answer’s Server-Timing header (og-queue, og-render). The server sends it only to a browser that measures: the dev server, a browser with the devtools turned on, or the profiler’s logged-in user. Nobody else learns how busy your server is.

Main thread

Main thread uses the browser’s own sampler (the JS Self-Profiling API, in Chromium) to record the page load: the first 8 seconds, and up to 20 while islands are still waking. It shows busy time by kind of code (your app, ogygia, svelte, a dependency, a page script, the browser, and the devtools themselves) and the functions that ran, with their file and line. Each island’s row shows the CPU used inside its hydrate window. Press record 5 s to sample again while you use the page, for a click or a navigation. The trace stays in the page.

The sampler needs the page served with a Document-Policy: js-profiling header. The dev server sends it, and in a build ogygia.handle() sends it to a browser that turned the devtools on (unless your app already set a Document-Policy). A prerendered page has no server to send it, so set it on your host for those. On a host that reads a _headers file, that’s:

Without the header, or in a browser without the API, the section says so and the findings fall back to what the browser’s long-animation-frame records say: the script, not the function.

/*
  Document-Policy: js-profiling

Render-blocking files

Blocked the first paint lists each file the browser waited on before it could paint, slowest first, with its time and size.

Files by type counts scripts, styles, images, fonts and fetches, with their bytes. Every file counts, not only the first ones: the browser’s resource list stops at 250 entries unless a page asks for more, and the devtools ask for up to 3,000.

Styles

Styles lists every stylesheet on the page, linked or inline, with its rule count, its size, whether it held the first paint, and how many of its rules match nothing on the page right now. The dock’s own styles are left out.

Content that appears later, such as a menu or a dialog, counts as unmatched until it’s open. Open it, then press check again. The tab also checks again on its own after each in-app navigation.

Since your last load

Change some code, let the page reload, and Since your last load lists what changed on this page: findings fixed and new (by island), islands whose module load or hydrate step got faster or slower, and vitals that moved. A moved vital names the part that moved most, using the same parts as its finding: “LCP 2.9 s → 500 ms, mostly its download 2.7 s → 300 ms”.

Small wobbles are left out by the same rule the profiler’s “since your last profile” uses, so the two never disagree. On the dev server, a load whose numbers came from the page’s first compile isn’t counted as a change. Each page’s last load is kept in this browser tab’s sessionStorage only.

After the SPA router swaps in a new page, the tab reports on the new page: its findings and island rows count from the navigation. An island that’s on both pages with the same props is kept by the router, still awake, with nothing to load or hydrate; the tab lists it as kept, so a page whose islands were all reused doesn’t read as “nothing woke”. The Styles section reads the new page’s sheets.

The vitals stay those of the first load, labelled that way, because a navigation paints nothing the browser reports as a vital. The CPU trace also belongs to the first load, so press record 5 s for the new page. A slow navigation gets its own finding.

Browser support

Not every browser reports every kind of timing. When the browser lacks one, the tab lists it, so its silence doesn’t read as a clean result:

  • layout shifts (the shift an island caused as it woke is then estimated from its box before and after);
  • the largest paint;
  • interaction timing;
  • long tasks (the stalls are then estimated from frames drawn late);
  • which script held a frame (long-animation-frame records);
  • the main-thread CPU sampler.

Safari, for example, reports no layout shifts, long tasks or CPU samples, so a finding that needs one of those can’t appear there. Check those in Chromium.

Profiler tab

A slow first byte is the server’s time, and the browser can’t see inside it. The dock’s Profiler tab can. It runs the SSR profiler on a page without leaving it, so it needs the profiler turned on:

Set path (this page by default) and renders (1 to 50, default 5), then press Profile this page. The page renders through your real server that many times, and the tab shows:

  • the page’s score and grade, with each category’s score, and what was left out of the score;
  • the server render time (the median of the renders), what it would be after the fixes, and the page seed’s size;
  • What the page loads: its files, the JS at start and on demand, and what each file holds;
  • What the fixes save, the findings with their estimated saving;
  • Findings: the report’s findings, the first 12 of them (the rest are in the full report);
  • The server’s hottest code, by its own time per render, and the outbound calls;
  • Islands on the server: each island’s render time, props size and browser hydrate time. Each row is linked to the island on this page: hover to light it up, click to open its card, where the same numbers appear under “on the server”;
  • Heaviest components, alone and with their children;
  • On this page: the measured costs that have a place on the page, such as the heaviest islands, the components (by the elements they rendered, on the dev server), the declarative shadow roots the server wrote (and how many the browser refused) and the largest paint. Hover one to light up its elements, or click to pin the highlight and scroll there.

full report ↗ opens the profiler’s full report for the run. The Page tab uses the last run too: a slow-first-byte finding quotes its render time, outbound calls and verdict, or says to run one.

A few limits:

  • When the tab can’t reach the profiler, it says “The SSR profiler isn’t mounted” and suggests ogygia({ profiler: true }). That advice is wrong: ogygia() has no profiler option and the build refuses it. Turn the profiler on with devtools({ profiler: true }), as above. This is a known bug (#2304).
  • The tab looks for the profiler at /__profiler only. If you set the profiler’s path option to something else, or a build has no profiler secret (so /__profiler answers 404), the tab shows the same “isn’t mounted” message (#2304).
  • In a build, the profiler is behind its login. Log in at /__profiler in the same browser first.
import { sveltekit } from '@sveltejs/kit/vite';
import { ogygia } from 'ogygia/vite';
import { devtools } from '@ogygia/devtools/vite';
import { defineConfig } from 'vite';

export default defineConfig({
  plugins: [
    ogygia(),
    devtools({ profiler: true }),
    sveltekit()
  ]
});