Engineering1 min read

We deleted 3KB of JavaScript and the page got 600ms faster

We spent a week trying to make this site's largest contentful paint respectable on a throttled phone. Most of what we tried did nothing. One thing did almost…

By BlueX

We spent a week trying to make this site's largest contentful paint respectable on a throttled phone. Most of what we tried did nothing. One thing did almost all of it.

What did not work

Trimming the webfonts. We cut 44KB of unused weights, which is real bandwidth and exactly zero milliseconds of LCP — the faces are display: swap, so text paints in a fallback and the download never blocks anything.

What did

Deleting a GSAP plugin that was registered on every visit and never called.

// Registered at module scope. Never used.
gsap.registerPlugin(SplitText);

Three kilobytes of transfer, and roughly 600 milliseconds of main-thread time on a mid-range phone at 4× CPU throttle. Parsing and executing JavaScript is expensive in a way that downloading it is not, and a plugin that does nothing still has to be parsed before the page can do anything.

The lesson we keep relearning

  • Measure the previous commit, not your memory of it.
  • Five runs minimum. A single "after" number was 600ms off the median once.
  • Look for unused work before optimising used work.

Median LCP went from 3028ms to 2500ms. Everything else we tried is still in the branch, unmerged.

Five minute callback

Tell us where to call.

Our AI agent rings you back in under five minutes, qualifies what you need and books the meeting.