Web Performance Basics
Master the science of high-speed web apps: the Critical Rendering Path, Google Core Web Vitals (LCP, INP, CLS), modern image delivery, main-thread optimization, edge caching, and real-user monitoring.
The Speed Imperative
Web performance is not merely about raw download numbers — it is the total subjective experience of how quickly a website loads, how smoothly it reacts to user gestures, and how stable its visuals remain.
Studies consistently demonstrate that every 100ms improvement in load time increases conversion rates by up to 8%, while unexpected layout shifts and janky inputs drive user frustration and hurt Google search rankings.
The 3 Pillars of Web Performance
Loading Performance
How quickly resources (HTML, CSS, JS, images) arrive over the network and render the primary content onto the screen.
Runtime Performance
How smoothly the page responds to user clicks, scrolling, typing, and complex UI animations without stutter or main-thread freezes.
Perceived Performance
How fast the website feels to the user through the use of skeleton loaders, optimistic UI updates, and instant visual feedback.
The Critical Rendering Path
To display pixels on the screen, every browser executes a strict multi-stage pipeline:
Request → HTML Parsing (DOM) & CSS Parsing (CSSOM) → Render Tree → Layout (Reflow) → Paint → Composite
Google Core Web Vitals (The Official Standards)
LCP — Largest Contentful Paint
Measures how long it takes for the largest visual block (hero image or heading) to render.
INP — Interaction to Next Paint
Measures the delay between a user click/keypress and the resulting visual frame update.
CLS — Cumulative Layout Shift
Measures unexpected layout jumps and element shifting while content is loading.
Modern Image Optimization
Images account for over 60% of average web page weight. Follow these 4 gold rules:
<picture>
<source srcset="hero.avif" type="image/avif">
<source srcset="hero.webp" type="image/webp">
<img
src="hero.jpg"
width="1200"
height="600"
alt="Hero Product"
fetchpriority="high"
/>
</picture>JavaScript & Main Thread Budget
Browsers execute JavaScript on the main thread. Any task taking longer than 50ms is classified as a Long Task, creating lag and degrading your INP score.
Lab Data vs. Real User Monitoring (CrUX)
Lighthouse simulates a single load under fixed synthetic conditions. Real visitors experience diverse mobile CPUs, flaky 4G networks, and long session interactions. Always prioritize Field Data (CrUX) over raw synthetic scores!
🔥 Live Interactive — Performance Lab
Diagnose a deliberately slow website and toggle real-world optimizations to watch Core Web Vitals improve in real time.
Test your diagnostics skills: identify bottlenecks and apply targeted architectural fixes.