I Put This Portfolio on a 200 KB Budget
The root motion provider taxed every route. The measured before and after, the per-route budget gate, and why PageSpeed says 100 and a stricter profile says 93.
Answer in 30 seconds
PageSpeed Insights on 2026-10-30 reports 100 mobile and 99 desktop for the deployed site; mobile FCP and LCP are 1.1s and TBT is 40ms. A stricter Lighthouse run with a 4x CPU slowdown scores 93 with a 3.3s simulated LCP. Both are real: the difference is the profile, not the page. The portfolio ships 182.9 KB gzip of first-load JavaScript on the homepage and 170.7–188.9 KB across routes, enforced by a per-route budget gate. Removing a root motion provider, rewriting the hero without the motion runtime, and excluding legacy noModule polyfills cut roughly 45 KB of modern-browser payload.
This site sells speed. For a while, its own homepage was the heaviest route on it. That is the kind of contradiction a buyer is right to catch, so I fixed the measurement first, then the site, then made the budget a gate that fails the build.
This is the teardown, including the number that is still not a 100.
The tax was in the root layout
The homepage had a MotionProvider wrapped around the entire app in src/app/layout.tsx. That meant every route, including text-only blog posts and the contact page, downloaded the motion runtime whether it animated anything or not. The hero also imported useScroll, useSpring, useMotionValue and useInView for a scroll-exit parallax and a cursor-depth effect.
None of that is wrong on its own. The mistake was placement: a root-level provider makes an enhancement part of the floor. A page that only renders headings and paragraphs should not pay for a spring engine.
Fix the ruler before the thing it measures
The first useful finding was embarrassing. scripts/measure-first-load.mjs was counting every <script src> in the prerendered HTML, including Next's noModule legacy polyfill bundle. A browser that understands module scripts never fetches that file. The old homepage number was 266.5 KB gzip, but about 38.7 KB of that was a polyfill modern browsers skip.
On the same modern-browser basis, the honest before was roughly 228 KB. After the changes, the homepage is 182.9 KB. The real cut is about 45 KB, not the 84 KB the raw before/after suggested.
That correction is now in the script: noModule scripts are excluded, and the comment says why. A measurement that flatters the site is worse than no measurement.
The changes that moved the number
1. The root provider came out. Each animated island now owns a MotionProvider internally: the wall, the pinned method, the statement, the live ticker, the tier marquee, the word reveal. If the island never loads, the runtime never loads. The root layout no longer imports motion/react.
2. The hero became CSS and SVG. The scroll-exit and pointer parallax were removed rather than relocated. The underline is a CSS-drawn SVG path; the orbit ring is a static SVG with one slow CSS rotation; the ship-velocity bars use a tiny IntersectionObserver hook. The hero still has its staggered entrance and the ember underline. It just does not hydrate a spring engine to get them.
3. The budget became route-aware. pnpm budget used to check one global chunk total. It now reads each prerendered route's initial <script src> set and enforces:
- homepage: ≤ 200 KB gzip
- every other route: ≤ 210 KB gzip
Current measurements from a production build:
| Route | First-load gzip |
|---|---|
/ | 182.9 KB |
/contact | 188.9 KB |
/work | 183.6 KB |
/blog | 177.2 KB |
/services | 171.0 KB |
/about | 175.8 KB |
The gate is not a report. It exits non-zero and fails verify:all.
Two Lighthouse numbers, and why they differ
PageSpeed Insights, 2026-10-30, on the deployed site:
- Mobile: Performance 100. FCP 1.1s, LCP 1.1s, TBT 40ms, CLS 0.
- Desktop: Performance 99. FCP and LCP 0.3s, TBT 104ms, CLS 0.
- Accessibility, best practices and SEO: 100 on both.
My CLI run first reported 93 mobile / 3.3s LCP. That was not a different site. It was a different profile: Lighthouse CLI's default mobile CPU slowdown is 4x, while PageSpeed Insights runs at 1.2x and saw a 4ms server response from its location. Running the same CLI against production with PageSpeed's 1.2x CPU multiplier reproduces 100, with a 1.1s LCP.
The stricter 4x run is still useful: it is the slow-laptop stress test. It is not the Google score, and reporting it as the site's Lighthouse result would be misleading. Both numbers belong in the post.
The critical path is still roughly 112 KB of webfonts and 183 KB of first-load JS. The 4x run shows where that weight bites. I tried the obvious levers:
- deferring the mono font preload: no measurable LCP change
display: optionalon the body face: no measurable LCP change- removing the hero subhead's entrance animation: no measurable LCP change
The remaining lever is weight: subset the three font files, or drop one of the designed faces, or cut framework/runtime bytes. Those trade the type system or the interaction model, so they are owner decisions, not cleanup. I would rather publish both profiles than pick the flattering one.
What the gate protects
The performance work is only durable if a future commit cannot quietly undo it. The budget runs after every build. The Playwright suite (58 tests at the time of writing, including 19 route templates × 2 themes under axe) runs in the same verify:all chain. So does the link and docs check, the 132 unit tests, and the circular-dependency check.
If you want the same treatment on a site that is slow, leaking leads, or carrying a framework it does not need, the 5-Day Conversion & Speed Sprint is the fixed-scope version: one critical flow, five business days, before/after measurement, and a written diagnosis. If you want to see whether your site has the same problem first, run the free grader. It takes a URL and gives you the checks that matter without an email wall.
The code for this site is the proof of method, not a client case study: it is self-initiated, and the work section says so. The measurements are dated, reproducible, and include the ones that are still short of perfect.
Work with me
Need the same speed work on your site?
Seven live builds with dated measurements and fixed prices published up front. Read the breakdowns, or send me the rough version of your problem.
Not sure which service fits? Find your fix in three questions →
Related reads
From 79 to 90: The Taylors Cut Speed Teardown
A Taylors Cut teardown: Lighthouse mobile 79 to 90 (LCP 3.96s to 3.31s, TBT 362ms to 182ms) and desktop 99 to 100, measured before and after on the same day. Including the three fixes that did nothing.
How a 768 KB Preload Made a Storefront Take 7.2s to Paint
A Small Batch Brine teardown: Lighthouse mobile 74 with a 7.2s LCP, one root cause, and the fixes that took it to 97 (LCP 2.0s). Dated and reproducible.
From 5.9s to 3.8s: Why a Hidden Hero Makes Everything Slow
A Through Tenon teardown: Lighthouse mobile 75 with a 5.9s LCP caused by an entrance animation, and the fixes that recovered two seconds.