Skip to content

← Blog#frontend

Web Performance Is Perception: The Metrics Users Actually Feel

The metrics that move the needle are the ones that map to how a UI feels - LCP, INP, CLS - not the ones that look good on a chart.

Muhammad Zain Ul Abidin6 min read
On this page
Web Performance Is Perception: The Metrics Users Actually Feel

There's a temptation to optimize for numbers that don't matter. Bundle size, TTFB, server response time - these are real signals, but they describe the delivery of a page, not the experience of using it. Two pages with identical Lighthouse scores can feel completely different to a real user.

The metrics that matter are the ones that map to perception.

The three that count

LCP - does anything appear?

Largest Contentful Paint measures when the biggest above-the-fold element becomes visible. Not when the document loads. Not when the framework boots. When the user sees something they came for.

A page can score perfectly on every other metric and still feel slow if LCP is bad. A page can score mediocre everywhere else and feel fast if LCP is under 1.5 seconds.

INP - does it respond when I touch it?

Interaction to Next Paint measures the worst input-to-response time during a session. Click a button, type a character, tap a link - INP measures the slowest of these. Below 200ms feels instant. Above 500ms feels broken.

INP is harder to fix than LCP because it's not about the initial load. It's about every interaction afterward. Long-running effects, expensive renders, synchronous deserialization - anything that blocks the main thread during a user action shows up here.

CLS - does the layout stop moving?

Cumulative Layout Shift counts the visual jank of late-arriving images, ads, fonts, embeds. Below 0.1 feels stable. Above 0.25 feels like quicksand.

CLS is usually the cheapest to fix and the most ignored. Reserve aspect ratios. Specify image dimensions. Use font-display: swap with size descriptors. Don't insert content above the user's reading position after load.

What I actually do

For LCP: render the hero on the server, ship the critical CSS inline, no client-side data fetching for content above the fold, use next/image with priority on the LCP element. For INP: defer everything that isn't immediately interactive, virtualize long lists, never run sync JSON.parse on multi-MB strings during a render.

For CLS: explicit width/height on every image and embed, reserve ad slots with min-height, use CSS aspect ratios for responsive media, never inject banners above the fold post-load.

ts
// Reserve ad slot space so AdSense fills don't shift content.
<div className="ad-slot ad-slot--in-article">
  <ins className="adsbygoogle" data-ad-client={CLIENT} data-ad-slot={SLOT} />
</div>
css
.ad-slot--in-article {
  min-height: 280px;
}

The point isn't the specific CSS - it's that reserved space is non-negotiable.

Speed the metrics don't see

Core Web Vitals cover loading, responsiveness and stability. They don't cover the moment after a user clicks "Save" and waits for the server. That wait is often the slowest part of an app, and no amount of bundle trimming changes it. What changes it is what the UI does while the user waits.

Optimistic UI

If an action almost always succeeds, show the result before the server confirms it. Toggle the like, add the comment to the list, move the card to the next column - immediately. Send the request in the background. If it fails, roll back and say so.

tsx
function LikeButton({ postId, initial }: { postId: string; initial: boolean }) {
  const [liked, setLiked] = useState(initial);

  async function toggle() {
    const next = !liked;
    setLiked(next); // show it now
    try {
      await setLike(postId, next);
    } catch {
      setLiked(!next); // undo, and tell the user
      toast.error("Couldn't save that. Try again.");
    }
  }

  return <button aria-pressed={liked} onClick={toggle}>Like</button>;
}

The network takes exactly as long as before. The user stops waiting for it. React also ships a useOptimistic hook for this pattern when you're working with actions and transitions; the principle is the same either way.

I don't do this for actions where being wrong is expensive. A payment, a delete with no undo, anything that sends an email - those wait for the server, with a clear pending state. Optimism is for actions that are cheap to reverse and rarely fail.

Skeletons vs spinners

A spinner says "something is happening". A skeleton says "this is what's coming, and where". When the skeleton matches the real layout - same heights, same columns, same rough text lengths - the content slots into place instead of appearing from nowhere. The page feels like it is filling in rather than starting over, and it doubles as CLS protection, because the space is already reserved.

Spinners still have a place: a single small action, like a button that's submitting, where there's no layout to preview. What I avoid is a full-page spinner in front of content whose shape I already know.

One more rule: don't flash a loading state for work that finishes almost instantly. A skeleton that appears and vanishes in a blink reads as a flicker, which feels slower than showing nothing. I delay the loading state slightly, and if the data arrives first, the user never sees it.

Preloading on intent

Users signal what they're about to do before they do it. The pointer moves toward a link, a tab receives focus, a user presses down on a card. Each of those moments gives you a head start between the signal and the click.

Next.js's Link already prefetches routes. For data and heavy components, I start the fetch on pointerenter or focus, and let the cache serve it when the click lands. Keyboard users get the same head start through focus, and touch users through pointerdown, which fires before the tap completes.

The constraint is cost. Preloading everything a user hovers wastes bandwidth and server time. I preload only what's likely and cheap: the next page of a list, the detail view of a hovered row. Not every link in a mega-menu.

Animation timing

Motion can make an interface feel faster or slower, and the difference is mostly duration. Short, quick transitions read as responsive. Long, slow ones make the user wait for the animation to finish before they can act, which is latency you added on purpose.

The rules I follow: feedback on press should be immediate. Transitions between states should be brief enough that nobody ever waits on them. Never block input until an animation completes. Respect prefers-reduced-motion and cut motion down for users who ask for it. And never use animation to hide a slow request - a long fade over a slow load makes both feel slower.

Measuring perceived speed

Lab tools tell you whether a change regressed. Real users tell you how the app feels. I collect field data with the web-vitals library and send it to analytics, then look at the 75th percentile rather than the average. The average hides the users on slow phones and weak networks, and those are the users who decide the app feels slow.

For the waits Core Web Vitals don't cover, I add my own marks with the User Timing API: performance.mark() when the user clicks, another when the result is on screen, performance.measure() between them. That turns "saving feels slow" into a number I can track release over release.

INP also comes with attribution data: which element was interacted with and where the time went - input delay, processing, or rendering the next frame. That tells you whether to look at a long task that was already running, your event handler, or an expensive re-render.

Common mistakes

Optimizing the lab score on a fast laptop. Your development machine is not your users' phone. Throttle the CPU and network when you test locally, and trust field data over either.

Spinners for everything. A spinner is the least informative loading state. If you know the shape of what's coming, show the shape.

Optimistic UI without a rollback. Showing success and then silently failing is worse than being slow. If you update the UI first, you owe the user an honest correction when the request fails.

Lazy-loading the LCP element. Lazy loading is for below-the-fold content. Applied to the hero image, it delays the one thing the user is waiting for.

Chasing a metric the user can't feel. Shaving bytes off a bundle that already loads quickly, while a slow save sits on the main flow, is effort spent in the wrong place. Start from the moment that feels slowest and work outward.

The mental model

Don't optimize for the score. Optimize for the feeling. The score is a proxy. When you focus on what the user perceives, the score follows.

Comments

No comments yet. Be the first.

Leave a comment

Comments are reviewed before they appear.