Performance review: final numbers for both bundlers, memory measured on its own, the font decision measured
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
45c6dcd968
commit
9bac7e7bf0
+40
-27
@@ -24,43 +24,55 @@ Raw results: `webpack-before.json`, `webpack-after.json`, `turbopack-before.json
|
||||
|
||||
### Server: one render of a page (ISR bypassed), webpack build
|
||||
|
||||
| Page | Queries before → after | Render ms before → after |
|
||||
|---|---|---|
|
||||
| home `/pl` | 43 → 24 | 95 → 51 |
|
||||
| page `/pl/o-nas` | 34 → 21 | 54 → 34 |
|
||||
| archive `/pl/blog` | 34 → 23 | 63 → 42 |
|
||||
| post | 41 → 26 | 61 → 41 |
|
||||
| case study | 37 → 22 | 33 → 31 |
|
||||
| form `/pl/wycena` | 30 → 19 | 28 → 29 |
|
||||
| showcase `/pl/bloki` | 42 → 27 | 68 → 62 |
|
||||
| 404 | 25 → 20 | 29 → 26 |
|
||||
| Page | Queries before → after (both bundlers) | Render ms webpack | Render ms Turbopack |
|
||||
|---|---|---|---|
|
||||
| home `/pl` | 43 → 24 | 95 → 51 | 57 → 41 |
|
||||
| page `/pl/o-nas` | 34 → 21 | 54 → 34 | 41 → 38 |
|
||||
| archive `/pl/blog` | 34 → 23 | 63 → 42 | 32 → 29 |
|
||||
| post | 41 → 26 | 61 → 41 | 41 → 30 |
|
||||
| case study | 37 → 22 | 33 → 31 | 33 → 24 |
|
||||
| form `/pl/wycena` | 30 → 19 | 28 → 29 | 28 → 22 |
|
||||
| showcase `/pl/bloki` | 42 → 27 | 68 → 62 | 73 → 50 |
|
||||
| 404 | 25 → 20 | 29 → 26 | 27 → 19 |
|
||||
| `/md/pl`, `/llms.txt`, `/llms-full.txt`, `/sitemap.xml` | 16, 22, 38, 0 — unchanged | — |
|
||||
|
||||
All query time on a local MongoDB is ≤ 1 ms per render: the count is what costs on a remote database (one round trip
|
||||
each — on Coolify's Docker network ~0.2–0.5 ms, more on a managed database). A cached (ISR) page answers in
|
||||
3.5–3.7 ms median, 5.4 ms p95, with 0 queries, before and after. Cold start (spawn → health) 1.0–1.6 s; server RSS
|
||||
after the run 340–440 MiB (noisy between runs; no change attributable to this branch).
|
||||
2.5–3.7 ms median, ≤ 5.4 ms p95, with 0 queries, before and after. Cold start (spawn → health) 1.0–1.6 s, no change.
|
||||
Memory, measured on its own (`next start`, Turbopack build: boot → 100 cached requests → 40 renders): 1.17.2
|
||||
282 → 295–318 → 417–421 MiB, this branch 282 → 295 → 394 MiB (two runs each). The RSS that `perf:measure` prints
|
||||
after its whole run swings by ±100 MiB with garbage collection; do not compare it.
|
||||
|
||||
### Client: lab, median of 3, phone (Slow 4G, CPU 4×) / desktop
|
||||
|
||||
| | Before (webpack) | After (webpack) | Before (Turbopack) | After (Turbopack) |
|
||||
|---|---|---|---|---|
|
||||
| JS per page, compressed | 191.3 KB | 188.1 KB | 184.4 KB | see turbopack-after.json |
|
||||
| CSS | 11.0 KB | 11.0 KB | 12.0 KB | |
|
||||
| Fonts | 209.5 KB | 209.5 KB | 209.5 KB | |
|
||||
| Requests (home, phone) | 26 | 26 | 26 | |
|
||||
| LCP phone (pages) | 788–832 ms | 780–828 ms | 796–836 ms | |
|
||||
| LCP desktop | 284–316 ms | 288–300 ms | 284–300 ms | |
|
||||
| CLS | 0 (home 0.036) | 0 (home 0.036) | 0 (home 0.036) | |
|
||||
| TBT phone | 22–25 ms | 16–23 ms | 6–13 ms | |
|
||||
| Tap response (INP proxy) | 32–40 ms | 32–48 ms | 32–48 ms | |
|
||||
| Render-blocking | 1 (the stylesheet) | 1 | 1 | |
|
||||
| 404: LCP / CLS (phone) | 2.49 s / 0.319 | 2.50 s / 0.319 | 2.37 s / 0.319 | |
|
||||
| `/admin/login` JS | 843 KB | 843 KB | — | |
|
||||
| JS per page, compressed | 191.3 KB | 188.1 KB | 184.4 KB | 181.6 KB |
|
||||
| JS, showcase (every block) | 219.6 KB | 216.4 KB | 212.7 KB | 209.9 KB |
|
||||
| CSS | 11.0 KB | 11.0 KB | 12.0 KB | 12.0 KB |
|
||||
| Fonts | 209.5 KB | 209.5 KB | 209.5 KB | 209.5 KB |
|
||||
| HTML | 17.0–19.8 KB | 17.1–19.8 KB | 17.1–19.9 KB | 17.1–19.9 KB |
|
||||
| Requests (home / page, phone) | 26 / 21 | 26 / 21 | 26 / 21 | 26 / 21 |
|
||||
| LCP phone (pages) | 788–832 ms | 780–828 ms | 796–836 ms | 820–868 ms |
|
||||
| LCP desktop | 284–316 ms | 288–300 ms | 284–300 ms | 288–304 ms |
|
||||
| CLS | 0 (home 0.036) | 0 (home 0.036) | 0 (home 0.036) | 0 (home 0–0.036) |
|
||||
| TBT phone | 22–25 ms | 16–23 ms | 6–13 ms | 1–7 ms |
|
||||
| Tap response (INP proxy) | 32–40 ms | 32–48 ms | 32–48 ms | 32–40 ms |
|
||||
| Script time (parse, run, hydrate), phone | 117–124 ms | 110–118 ms | 76–82 ms | 64–76 ms |
|
||||
| Render-blocking | 1 (the stylesheet) | 1 | 1 | 1 |
|
||||
| 404: LCP / CLS (phone) | 2.49 s / 0.319 | 2.50 s / 0.319 | 2.37 s / 0.319 | 2.31 s / 0.319 |
|
||||
| `/admin/login` JS | 843 KB | 843 KB | — | — |
|
||||
|
||||
Lab numbers on localhost: LCP is the network profile plus render, so the differences between pages are small; the
|
||||
budgets and the gate catch regressions, PageSpeed Insights shows the field.
|
||||
|
||||
On every page FCP = LCP: the first paint waits for the one stylesheet, which on the phone profile (1.6 Mbit/s) shares
|
||||
the line with four preloaded font files (209 KB) and the async script chunks. With Turbopack the phone's first paint
|
||||
came out 20–50 ms later after this branch (three runs on a quiet machine; webpack unchanged), although it ships 2.8 KB
|
||||
less JS and nothing new blocks: Turbopack splits the client chunks differently once the barrels are no longer one
|
||||
client boundary, and on that line the order of downloads moves the stylesheet a little. The fonts are the bigger
|
||||
lever (decision 2 below: −36 to −52 ms).
|
||||
|
||||
## Audit — what the plugin does, file and line, and the gain of each fix
|
||||
|
||||
Sources: web.dev (vitals, optimize-lcp, cls, optimize-inp, font-best-practices, animations-guide,
|
||||
@@ -105,9 +117,10 @@ the proxy does no database work; the 434 KB cookie database is loaded only by a
|
||||
the 404 eagerly — LCP and CLS as any page, but every page's HTML grows by the 404 content in every language
|
||||
(pages.md: a two-language home page as the 404 made a page 195 KB gzip instead of 146 KB). Recommendation (a).
|
||||
2. **Fonts: 209.5 KB, four preloaded files** (Inter + Fraunces, latin + latin-ext). Each variable family has two
|
||||
subset files. Options: Fraunces `preload: false` (headings swap in late, fallback metrics keep CLS ~0) — −70 KB
|
||||
of preloads competing with the hero; or one family. A design decision for the reference site and the starter
|
||||
default. Gain on a phone: ~0.3 s less contention on Slow 4G; cost: a visible heading swap.
|
||||
subset files. Measured (Turbopack, phone, median of 5): Fraunces with `preload: false` → first paint and LCP
|
||||
−36 to −52 ms on home, page and post; the same 209 KB still downloads (the headings use it), and the home page's
|
||||
CLS goes from 0 to 0.036 (the headings swap, < 0.1). One family instead of two would save ~70 KB as well. A design
|
||||
decision for the reference site and the starter default. Recommendation: `preload: false` on the heading font.
|
||||
3. **Form code on every page (≈ 10 KB compressed).** The catch-all route renders any block, so the contact form's
|
||||
client code (BuilderForm, Turnstile provider) is in every page's bundle. A `lazy()` wrapper would load it only on
|
||||
pages with a form; SSR stays complete. Gain −10 KB on most pages; cost: a hydration wait on the form, test effort
|
||||
|
||||
Reference in New Issue
Block a user