mid · lesson 5 of 8

Performance

CLS, INP, image strategy, JS budgets.

Sidhanshu Monga·1 min·
You’ll be able to
  1. Read the three Core Web Vitals and what each one measures
  2. Prevent layout shift with reserved space
  3. Keep interactions responsive by keeping the main thread free

Performance is part of how an interface feels. A page that loads fast but jumps around, or responds to clicks half a second late, still feels slow.

Core Web Vitals

Google's Core Web Vitals measure three parts of that experience. A page is considered good when at least 75% of visits meet each threshold:

MetricMeasuresGood
LCP — Largest Contentful Paintwhen the main content appears2.5 s or less
INP — Interaction to Next Painthow quickly the page responds to input200 ms or less
CLS — Cumulative Layout Shifthow much content moves unexpectedly0.1 or less

INP replaced First Input Delay as a Core Web Vital in March 2024, because it measures every interaction, not just the first.

Layout shift

Content that moves after it appears is disorienting and causes mis-clicks. Reserve space for anything that loads late: give images width and height (or aspect-ratio), size ad and embed slots, and make skeletons match the real layout. Load web fonts in a way that avoids large reflows.

Responsiveness

INP suffers when the main thread is busy. Break long tasks into smaller pieces, move heavy work off the main thread, and give immediate visual feedback (a pressed state, an optimistic update) before doing expensive work.

Images and JavaScript

Images are often the largest content: serve modern formats at the right size and lazy-load those below the fold. JavaScript is the most expensive byte to ship because it must be downloaded, parsed and run. Set a budget and check new dependencies against it.

Try it

Run your most important page through PageSpeed Insights or the Performance panel in DevTools. Find the single biggest issue among LCP, INP and CLS, fix it, and measure again.

Key takeaways
01Measure what users feel, not just load time
02Reserve space for anything that loads late
03Long tasks on the main thread are the enemy of responsiveness