Chapter 40: Performance

Performance (Web Performance)

When people say “performance” in the context of websites/apps, they almost always mean:

How fast does the page feel to the user? How quickly can they see something useful? How smooth is the scrolling, clicking, typing? How much data does it consume (especially on mobile 4G/5G in India)?

In 2026, performance is not a “nice to have” — it is a core business metric:

  • Google ranks faster sites higher (Core Web Vitals are part of ranking)
  • Amazon found +100 ms delay → -1% sales
  • Flipkart / Swiggy / Zomato lose real money every extra second of load time
  • Users on slow 2G/3G in tier-2/3 cities abandon sites very quickly
  • Poor performance → higher bounce rate → lower conversions → less revenue

So today I’ll explain web performance like I’m your senior mentor who’s actually improved page speed from 12 s → 1.8 s in production projects.

1. What Actually is “Performance” in Web Terms?

Performance = how fast and smooth the user experience feels from the moment they click a link until they can actually use the page.

We measure it in two big categories:

Category What it cares about Main metrics (Core Web Vitals 2026) Who feels it most
Initial Load How fast the page becomes visible & usable LCP (Largest Contentful Paint) First-time visitors, mobile users
Interactivity How fast the page responds to clicks/taps FID/INP (Interaction to Next Paint) Everyone who clicks anything
Visual Stability Does the layout jump around while loading? CLS (Cumulative Layout Shift) Readers, scrollers
Overall Smoothness Scrolling, animations, long tasks TBT (Total Blocking Time), FPS Heavy users, long sessions

Google’s Core Web Vitals (the official ones that affect SEO):

  • LCP ≤ 2.5 s (good)
  • INP ≤ 200 ms (good)
  • CLS ≤ 0.1 (good)

2. The Performance Waterfall – What Really Happens When a Page Loads

When someone types your URL or clicks a link, roughly this happens:

  1. DNS lookup → find server IP (50–200 ms)
  2. TCP connection → handshake (50–300 ms)
  3. TLS handshake (HTTPS) → encryption (100–400 ms)
  4. Server response → TTFB (Time to First Byte) – backend time
  5. HTML download → the document itself
  6. Parse HTML → build DOM
  7. Download & execute CSS → style the page
  8. Download & execute JS → add interactivity
  9. Download images/fonts → fill content
  10. Render → paint pixels on screen (LCP moment)
  11. User interacts → JS runs → INP moment

Biggest enemies in India (2026 reality):

  • Slow 4G/5G in tier-2/3 cities
  • Expensive mobile data → users on 1–2 GB plans
  • Low-end Android phones (2–4 GB RAM, weak CPU)
  • Heavy JS frameworks that block main thread

3. Most Important Performance Improvements (Practical 2026 List)

Here’s what actually moves the needle:

# Improvement How much impact (typical) How to do it (simple version) Tools to measure
1 Compress & optimize images 30–70% of total size Use WebP/AVIF, srcset, lazy loading Lighthouse, PageSpeed Insights
2 Minify & compress CSS/JS/HTML 10–40% size reduction Use build tools (Vite, Parcel, esbuild) Lighthouse
3 Remove render-blocking resources 1–3 s faster LCP Inline critical CSS, defer/async JS Lighthouse
4 Lazy load below-the-fold images/videos 20–50% faster LCP loading=”lazy” on <img>, <iframe> DevTools Network tab
5 Use modern image formats (WebP/AVIF) 25–60% smaller images <picture> with fallback to JPEG Squoosh.app
6 Reduce JavaScript execution time Huge INP improvement Code-split, tree-shake, avoid heavy libs on initial load Lighthouse + Performance tab
7 Font optimization 0.5–2 s faster FCP font-display: swap, preload important fonts Lighthouse
8 Preconnect / DNS-prefetch 100–500 ms faster <link rel=”preconnect” href=”https://fonts.googleapis.com”> DevTools
9 Cache everything possible Repeat visits instant Cache-Control headers, Service Worker (PWA) Lighthouse
10 Avoid layout shifts (CLS) 0.1 → 0.0 CLS score Set width & height on images, use aspect-ratio Lighthouse

4. Real Before/After Example – A Simple Page

Before (slow, unoptimized – common beginner code)

HTML

Problems:

  • No viewport meta → mobile zoomed out
  • Big JPEG image → 2–5 MB → slow LCP
  • Blocking CSS & JS in <head> → late render
  • No lazy loading → image loads even if below fold

After (optimized & responsive – 2026 style)

HTML

Typical results:

  • Before → LCP 4–8 seconds, INP 300–600 ms
  • After → LCP < 2 s, INP < 150 ms, CLS ~0

Quick Performance Mastery Checklist (Beginner 2026)

  • Always include viewport meta tag
  • Every image has loading=”lazy” + width/height attributes
  • Use WebP/AVIF with <picture> fallback
  • Defer non-critical JS (defer or async)
  • Inline critical CSS (above-the-fold styles)
  • Run Lighthouse in Chrome DevTools → aim for 90+ Performance score
  • Test on real 3G/4G mobile (DevTools throttling)

How does it feel when you realize one 2 MB image can make your page 5× slower? That’s why performance is money in real products.

Next possible lessons — tell me what you want:

  • “Step-by-step Lighthouse optimization guide”
  • “How to lazy-load images/videos properly”
  • “Critical CSS – how to extract & inline it”
  • “Web Vitals deep dive – LCP, INP, CLS explained”
  • “Performance budget – how much JS/CSS is too much?”

You’re now thinking about real user experience, not just looks. That’s the mindset of a professional developer. Chai khatam? Fresh cup lao — let’s make fast websites! 🚀 ⚡ 😄

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *