Most web performance issues do not happen overnight—they creep in three kilobytes at a time. A developer imports an unshaken utility library for a single date helper, a marketing script injects an unoptimized third-party widget, or a large component hydrates eagerly on initial route load. Six months later, Interaction to Next Paint (INP) and Largest Contentful Paint (LCP) have quietly degraded across mobile devices.
Whether you are maintaining an internal analytics dashboard, a SaaS product, or a public listing on specialized industry partner directories, one-off speed audits decay within weeks unless performance budgets are enforced automatically in your CI pipeline.
Four practical guardrails catch performance regressions at pull-request time before they ever reach production:
1. Gate Pull Requests on JavaScript Bundle Size Limits
Shipping excess JavaScript remains the single biggest bottleneck for parse-and-execute time on mid-range mobile hardware.
- Configure your bundler (
Vite,Webpack, orRollup) or a lightweight CI check (size-limit) to fail the build whenever a route's initial gzipped JS payload exceeds a strict threshold (for example,120 KB). - Require an explicit review note whenever a pull request adds a new runtime dependency so heavy packages never slip in unnoticed.
2. Run Headless Lighthouse CI on Every Staging Preview
Lab metrics do not replace real-user telemetry, but automated Lighthouse runs on pull-request preview URLs catch obvious layout shifts and render-blocking assets immediately.
- Assert minimum thresholds for LCP (
< 2.5s), CLS (< 0.1), and Total Blocking Time across both mobile and desktop viewports. - Reserve explicit
widthandheightdimensions on images, embeds, and skeleton placeholders so asynchronous data fetches never cause content jumps.
3. Split Long Main-Thread Tasks for Better INP
When a click handler triggers heavy synchronous state updates or complex DOM recalculations, the browser freezes visually and INP spikes.
- Break expensive client-side filtering or data transformations into smaller chunks using
scheduler.yield()orrequestIdleCallbackso user input stays responsive. - Move heavy CSV parsing, chart aggregation, and sorting logic off the main thread into a dedicated Web Worker.
4. Pair CI Budgets With Real-User Monitoring (RUM)
Synthetic CI checks test clean preview environments, while field telemetry captures real cellular latency, cold caches, and low-end CPUs. Logging p75 Core Web Vitals per route lets you spot which real-world pages need edge caching or server-rendering adjustments first.
What performance checks or bundle budgets do you run in your CI pipelines right now? Share your setup in the comments.