rad experiment show bbe649529c18354e8fe687a6550e06ab9c78cbf5
by ee@did:key:z6MkvsiybCuk1WDZhh2aXDx7NTiZejKgWZygMNsUuXDMNvVQ · Apr 11 22:14 2026
inline 3 static stylesheets via hooks.server.ts transformPageChunk
Measurements
Metric
BaselineThe benchmark measurement of the unmodified code
CandidateThe code with the proposed optimization applied
DeltaThe performance change from baseline to candidate
page_load_ms (ms)primary
60.230 ms (n=1)
65.400 ms (n=1)
+8.58%REGRESSED
guide_ms (ms)secondary
94.100 ms (n=1)
98.900 ms (n=1)
+5.10%REGRESSED
home_ms (ms)secondary
44.200 ms (n=1)
49.900 ms (n=1)
+12.89%REGRESSED
learn_ms (ms)secondary
43.000 ms (n=1)
46.600 ms (n=1)
+8.37%REGRESSED
Annotations
hypothesis
Inline global.css + colors.css + typography.css into the prerendered HTML via hooks.server.ts transformPageChunk, eliminating 3 render-blocking CSS fetches from every cold-load sample. Expected savings on localhost vite preview: ~3–9 ms (at or slightly above the 2–6 ms noise floor).
next_action_hint
Stop targeting render-blocking CSS fetches — free on localhost. Real levers for loadEventEnd on this bench: (1) reduce HTML bytes the parser chews on /guides/user (Shiki 12.5 KB of inline styles across 160 occurrences with only 5 distinct values — extract to class-based rules in the Vite CSS bundle so HTML shrinks AND CSS is served once); (2) reduce hydration work in +layout.svelte; (3) investigate whether mdsvex / Shiki emits redundant wrapper nodes. Do NOT retry any variant of bulk CSS inlining.
rollback_reason
Net regression on every measured route. On localhost the RTT savings from skipping 3 CSS fetches are ~1–2 ms each (below noise), but synchronously parsing an extra 27 KB of CSS inside <style> blocks DOMContentLoaded and therefore loadEventEnd by more than that. bfebd4d (the orphan discard from the prior session) used almost this exact approach; re-running it confirms the prior session measured it and chose correctly.
what_happened
Build confirms the transform lands: /guides/user.html went from 150 KB to 177 KB with one 27 KB inline <style> and only the Vite bundle CSS left as a render-blocking link. All three routes regressed cleanly: page_load_ms median 60.23 → 65.40 (+8.6%), home 44.2 → 49.9, learn 43.0 → 46.6, guide 94.1 → 98.9. Every individual route is slower.
Base CommitThe starting commit before the optimization was applied