Performance
How I keep the site fast, what I measure, and what I do not. Every number here comes from a recorded run or a value in the code, and the page says which.
Rendering
- Pre-rendered pages. The landing page,
/about, role pages and skill pages are generated at build time. The landing page,/aboutand skill pages also revalidate every 86400 seconds (export const revalidate = 86400). Role pages have norevalidate, so they stay as built until the next deploy. - Closed set of dynamic routes. Role and skill pages use
generateStaticParamswithdynamicParams = false, so every valid page exists at build time and any other slug is a 404. The blog is the one exception:/blog/[slug]keepsdynamicParamson, because a post is published without a build. A slug that was not prerendered renders on its first request, and the Sanity webhook revalidates theblogtag. See Blog. - No data fetching on render, except the blog. Content is TypeScript in
src/content/. The blog reads Sanity through cached, tagged fetches with a one hour fallbackrevalidate. The server work at request time isPOST /api/resume-request, the blog webhook and Draft Mode. See Blog. - Readable before JavaScript. The first page is prerendered, and the hero entrance runs on CSS keyframes, so it plays from first paint, before hydration.
What ships to the browser
- No runtime styling code. vanilla-extract compiles styles to static CSS at build time.
- Shared JavaScript. The last recorded figure is 102 kB of shared First Load JS, from the Next 15.5.9 build. Next 16 no longer prints per-route sizes, so there is no like-for-like number since the upgrade. The record is in
docs/research/2026-10-11-dependency-audit.md. - No syntax highlighter. Shiki runs on the server only. A build of the code block change shipped 3,735 bytes more gzipped client JavaScript than the build before it, and no client chunk mentions Shiki. See Code blocks and the measurements below.
- Cookieless analytics. PostHog sets no cookies and stores nothing in the browser, so there is no consent banner to render. Heatmaps, surveys and feature flags are off, and field Web Vitals are on. See Analytics.
Fonts
Fonts are self-hosted through next/font, with display: "swap". A production build loaded in Chromium, light and dark, at 1440 and 390 px, across six routes made no request to Google Fonts or Google’s font host. Seven woff2 files load in total: Smooch Sans and Saira (one variable file each), Atomic Serif (variable, weights 200 to 800) and Prompt at 300, 400, 600 and 700. Every configured weight is used on some route. The detail is in docs/research/2026-10-11-dependency-audit.md.
Images
Photos go through next/image with a sizes attribute, so the browser picks a width that fits the layout. One image, in the About letter, is marked priority.
I chose the splash
A full-viewport splash holds the logo for a random 1300 to 1900 ms on every hard load, then dissolves in 200 ms. It is a product choice, and nothing ends it early or extends it. Content under it is already rendered. For a slow start there is a separate first-load chip that appears only if hydration takes longer than 800 ms. Both are described in Motion and transitions.
Measured budgets
The transition probe measures a production build in headless Chromium at 1440 by 900 on localhost. Each budget is the measured value plus a margin, and a real regression misses it by a wide margin. They guard against regressions; they are not field data.
| Budget | Limit |
|---|---|
| Frames showing the “Loading…” fallback | 0 |
| Cumulative layout shift, one client navigation | 0.02 |
| Cumulative layout shift, arriving on the landing page | 0.1 |
| New page title present after a client navigation | 150 ms |
| New page title fully opaque, client navigation | 650 ms |
| New page title fully opaque, hard load | 700 ms |
| A client navigation versus a hard load of the same page | At most 100 ms slower |
| Entrance travel | 24 px |
The full list, including dialog and scroll budgets, is in Motion probes. Those probes run locally and are not part of CI.
Code blocks
Measured when the configurable code block shipped (#500), on one machine, comparing the commit before it (35f5c35) with the change. Both are local production builds.
| Measure | Before | After | Change |
|---|---|---|---|
Client JavaScript, raw (.next/static) | 2,432,329 | 2,440,511 | +8,182 B (+0.3%) |
| Client JavaScript, gzip, summed per file | 780,040 | 783,775 | +3,735 B (+0.5%) |
| Client chunks (JavaScript files) | 84 | 85 | +1 |
| Client chunks that mention Shiki | 0 | 0 | none |
| Server highlight, 8 lines, warm (median) | 1.5 ms | 1.5 ms | within noise |
| Server highlight, 60 lines, warm (median) | 10.5 ms | 10.1 ms | within noise |
| Server highlight, 1,000 lines, warm (median) | 164 ms | 161 ms | within noise |
| Server highlight, first call in a process | 104-116 ms | 106-118 ms | within noise |
The server numbers time highlightCodeBlocks against the earlier codeToHtml call on the same TypeScript source, three runs of each in separate processes, 150 calls per run for the small sizes and 15 for the large one. The medians above are the middle of the three runs’ medians. The first-call row includes loading the grammar. Above 100,000 characters or 2,000 lines the new code skips highlighting and renders plain text, so it is faster there by design; the 1,000-line case is the largest one that is still highlighted. The check for Shiki searched the client chunks for oniguruma, createHighlighter, codeToHtml and shiki, and the same search found it in the server build.
These are a lab comparison on one machine, so they move with the machine. They show the change added no highlighter to the client and no measurable server cost. They say nothing about field performance.
Field data
The /performance route publishes the 75th percentile of LCP, INP and CLS from real visits, with the sample size per metric and the window (the last 28 days). It is field data: measured in visitors’ browsers by PostHog, not a lab run, so it moves with devices and networks.
- Source. A server-side HogQL query against PostHog’s
$web_vitalsevents, cached for a day. The personal API key is server-only and never ships to the browser. Setup is in Analytics. - Hidden by default. The route is a 404 when the keys are not set, the request fails, or any metric has fewer than 100 samples. A percentile of a few visits would mislead.
- Caveats. Visitors who send Do Not Track are not counted. Samples include my own visits. Ratings use Google’s thresholds (LCP 2.5 s and 4 s, INP 200 ms and 500 ms, CLS 0.1 and 0.25).
- Not yet linked. The route is out of the sitemap and navigation until the numbers are worth publishing.
Lighthouse baseline
One lab run, recorded on 2026-10-24 before the assistant work (#390) so later changes have a number to compare against. It is a local production build (pnpm build && pnpm start) on one machine, so it moves with the machine and does not match PageSpeed Insights on the deployed site.
| Run | Performance | TBT | LCP | FCP | CLS |
|---|---|---|---|---|---|
| 1 | 75 | 366 ms | 4479 ms | 1668 ms | 0.000 |
| 2 | 75 | 342 ms | 4608 ms | 1663 ms | 0.000 |
| 3 | 74 | 368 ms | 4681 ms | 1662 ms | 0.000 |
Command: npx lighthouse@12.8.2 http://localhost:3000/ --only-categories=performance --form-factor=mobile with headless Chromium 1248 from Playwright, default simulated throttling. The median is 75 with a TBT of 366 ms. Compare a change against these numbers from the same setup. The 67 quoted in #390 came from a different setup and has no recorded source.
What I do not measure
These gaps are open:
- Lighthouse is run by hand. The baseline above is one dated run, and nothing in CI produces one.
- No target or alert on field data. The
/performanceroute reads the p75 figures (see Field data), but nothing sets a budget on them or alerts when they slip. - No bundle size gate. A growing client bundle would not fail a build.
- Probe numbers come from one machine and one browser.
Next I would record a Lighthouse run per release, and add a bundle size check once Next 16 reports sizes again.