@ogygia/devtools · Profiler
Comparisons
Did the fix work? What changed since a page's last profile, two reports side by side down to the line, whether a fix saved what the forecast promised, a page's history, the slow lines several pages share, and the whole site's requests from every instance.
On this page
A profile tells you what to fix. The next one should tell you whether the fix worked, and whether the time really went away or only moved. The profiler compares reports of the same page for you: at the top of every new report, on a compare page for any two, and across every page the server has profiled.
The quickest loop is to fix, then profile again against the report you started from. The run page opens the new report already compared:
/__profiler/run?p=/products&runs=5&against=k61lc2ejSince your last profile
When this server (or its store) holds an earlier profile of the same page, the report opens with what changed: “−68.6 ms since your last profile (163 → 94.4 ms), mostly: the Promise.all at +page.server.ts:24, −67.1 ms”. That’s the line-by-line comparison cut to three rows: the change in render time and the rows that really moved.
- It says no real change when the render moved by less than the spread between its own runs.
- It warns instead when the order of the runs skews the result: the earlier profile kept 8 MB or more alive on every render, so the later one ran on a fuller heap.
- When patterns went away, it compares what they promised with how far the render moved.
- When both profiles weighed the page, it adds how the JS at start moved and which files caused it (“JS at start 180 KB → 222 KB; new: the editor’s chunk 42 KB”), including a file that moved between start and later loading, which usually means an island’s
wakechanged. - When both had a browser visit, it lists browser findings that went away or appeared, and vitals that moved by more than the noise: a fifth of the old value and at least 50 ms for the first byte, 100 ms for the paints, 40 ms for the slowest interaction, and 0.05 for CLS (the same rule as the dock’s “since your last load”). For the first byte, the paints and the slowest interaction it names the part that moved most: “LCP 3,000 → 500 ms, mostly its download 2,790 → 290 ms”.
- It says what the deploy costs a returning visitor. Each island’s file is named after its content, so an island either kept its file (still cached) or changed it (downloaded again): two islands changed and 38 kept their files, so a returning visitor downloads 14.2 KB again for Probe and Twin. When every island changed, it asks whether their code really did, because SvelteKit bakes the build time into its own client code by default; set
kit.version.nameto your commit to avoid that.
The JSON from POST /page?format=json and the MCP digest carry the same thing as since.
Report history
Every page profile of a page joins that page’s history. The dashboard’s Pages over time draws the medians and scores over time and marks any jump, and each report links to compare with the previous run.
The compare page (/__profiler/compare/<a>/<b>) puts any two reports side by side: summary changes, phases, every component and function sorted by the size of its change, and the findings that appeared or went away. A positive change is red, meaning the second report is slower. When the server no longer holds one of them, the page compares from your browser’s kept copies.
It also compares the paths to fix: each path by its owner and file, its cost in each report, the functions on it, and whether it’s new or gone. A path that appears in the second report with its whole cost names the regression in one line, and a path whose cost doubled while its function list grew by one tells you which function did it.
Line-by-line comparison
The comparison lists which slow patterns a change fixed or introduced, and the exact lines before and after, per render. Lines are matched by their file and the code on them, not by line number: an edit above a line changes its number but not its code, so it keeps its row, and a rewritten line reads as the old line fixed and a new line added. Small patterns and cheap lines that come and go between runs of the same code aren’t reported as fixed.
Every CPU, GC, allocation, component, function and path number is per render, so a 3-render report and a 10-render report of the same code read the same.
Where one render’s time moved lists the rows of the two line-level breakdowns that changed, keeping only the deepest row of each chain. A row with a low–high range over renders on both sides counts as moved only when the ranges don’t overlap. When the render itself took the same time (within its runs’ spread), a CPU row’s change is marked shifted, because V8 inlines differently from run to run and can charge the same time to another function: newestReview −55 ms beside load:96 +62 ms is one swap, not two changes. Waits keep their verdict. A row missing on one side next to an N more row is taken at the fold’s size and never called fixed.
When both reports ran on one server and the earlier kept 8 MB or more alive per render, the page warns that the run order changes the result. Restart the server between the two.
Fix check
When patterns went away or shrank, the comparison checks whether the fix paid off. It takes the older report’s forecast, counts the parts that got done, adds them up the way the forecast does, and compares that with how much faster the median render got: “expected to save about 360 ms per render, and the median render got 364 ms faster”.
A part counts as done when its fix, or a fix it covers, went away. A part that shrank counts by its share, judged by its own lines: if every line the older report flagged is gone, it’s done, even if the newer report flags the same kind of pattern elsewhere. Deleted work counts as done when the newer report no longer has it.
When the render gained much less than expected, the time most likely moved somewhere else, so look for a line or a wait that got worse. When the run-order warning shows, the check says so instead: restart and profile again before trusting it.
Site-wide fixes
A slow line in a shared helper (a price formatter, an i18n lookup) shows up in the report of every page that calls it, and the dashboard adds these up. From the latest report of each page this server profiled, Fix once, faster on every page lists the lines two or more pages share (up to 8) and what fixing each gives back per render, per page and in total: ”catalog.ts:34, a key found by walking every entry: /deals ~49 ms, /search ~18 ms, ~67 ms in all”. A pattern’s saving is split over its lines by what each cost. Keeping answers and caching a whole page are per-page decisions, so they’re left out.
A report’s JSON and the MCP digest carry the same list for that page as shared (up to 5), so an agent fixing one page knows which fix pays off twice.
Site view
/__profiler/site (Whole site) draws every request as a dot, time across and duration up on a log scale, coloured by route, with caught requests marked. Drag across a range and the hot functions from the always-on sampling windows inside it appear, which turns “why are 3 percent of product pages slow?” into a selection.
Below it is the layer cake: for each route, the sum of its requests split into CPU, waiting on calls and everything else, sorted by total, with the count, p50 and p95.
On a long-lived host these come from the instance’s own memory. On a short-lived one they come from the sink: every instance posts its rows to a URL you own, and the page reads them back over days from wherever you serve them (/__profiler/site?from=<url>).
Hole statistics
The dashboard’s Holes on this server lists every hole the server answered since it started: requests, cache hits, failed renders, the mean render time, the mean wait for a render slot (with the worst in brackets), and each hole’s share of the time the slots were held. A server process renders 4 holes at a time, and a render holds its slot through its awaits, so a hole waiting on slow data keeps the next hole, for any visitor, in line. When holes had to wait, a line above the table says how many, for how long, and which holes held the slots: the first place to look.
On a host that runs one request per instance (AWS Lambda), nothing waits for a slot, but the table still shows each hole’s render and cache figures.