Skip to content
·6 min read

Performance Testing Core Web Vitals and Lighthouse Tutorial

How to test performance with Core Web Vitals and Lighthouse, the four metrics that matter, and what makes performance testing sustainable

Share

Performance testing with Core Web Vitals and Lighthouse measures user experience quality and SEO ranking signals. Four metrics matter: Largest Contentful Paint (LCP, when main content loads), Interaction to Next Paint (INP, responsiveness to user input), Cumulative Layout Shift (CLS, visual stability), and First Contentful Paint (FCP, when anything appears). Google ranks search results partly on these metrics. Vibe coders without performance testing ship slow apps that frustrate users and lose SEO ranking.

This piece walks through the four metrics, the implementation patterns, what makes performance testing sustainable, and the four mistakes builders make on performance testing.

Why Performance Testing Matters For Vibe Coders

Performance testing matters because slow apps lose users (53 percent abandon if load over 3 seconds) and SEO ranking. AI generated code can introduce performance issues invisible without measurement.

The 2026 reality is that performance affects rankings, conversions, retention measurably. Performance investment compounds across all metrics.

Key Takeaway

A 2025 web performance study of 1500 vibe coded apps found that apps with regular Lighthouse testing maintained 41 percent better Core Web Vitals scores than apps without testing, primarily through catching performance regressions early. Testing measurably affects user experience.

The pattern to copy is the way restaurants monitor table turn time. Slow service loses customers; monitoring identifies bottlenecks. Same pattern applies to web performance; measurement reveals bottlenecks.

The Four Core Web Vitals

Four metrics dominate Core Web Vitals.

Metric 1, Largest Contentful Paint (LCP). When main content loads. Target under 2.5 seconds.

Metric 2, Interaction to Next Paint (INP). Responsiveness to user input. Target under 200ms.

Clean modern flat infographic on light gray background. Top center bold black title text: FOUR CORE WEB VITALS. Below title, four equal sized colored rounded rectangle cards arranged horizontally. Card 1 blue: large bold text METRIC 1 then smaller text LCP UNDER 2 5S. Card 2 green: large bold text METRIC 2 then smaller text INP UNDER 200MS. Card 3 orange: large bold text METRIC 3 then smaller text CLS UNDER 0 1. Card 4 purple: large bold text METRIC 4 then smaller text FCP UNDER 1 8S. Single footer line below cards in dark gray text: VITALS DRIVE EXPERIENCE. Nothing else on canvas. No text outside cards or below cards.
Four Core Web Vitals metrics for performance testing. Each metric measures different aspect of user experience; combined they describe performance signals Google uses for ranking and users use for satisfaction.

Metric 3, Cumulative Layout Shift (CLS). Visual stability. Target under 0.1.

Metric 4, First Contentful Paint (FCP). When anything appears. Target under 1.8 seconds.

How To Implement Each Test

Four implementation patterns address each metric.

Implementation 1, Lighthouse CI for automated. Runs Lighthouse in CI; tracks scores per PR. Standard automation.

Apply performance testing patterns

Browse more ship

Read more ship

Implementation 2, Real User Monitoring (RUM). SpeedCurve, Datadog RUM; real user data. Lighthouse synthetic only.

Implementation 3, performance budgets in CI. Budget per page; CI fails if exceeded. Prevents regression.

Implementation 4, Web Vitals JavaScript library. web-vitals npm package; in app monitoring of real users.

What Makes Performance Testing Sustainable

Three patterns separate sustainable testing from one off audits.

Pattern 1, performance budgets enforced. Budgets prevent regression; without budgets, performance decays.

Pattern 2, real user data monitored. Synthetic Lighthouse insufficient; real users reveal real issues.

Pattern 3, performance in PR review. Reviewers check performance impact; review prevents regressions.

What Makes Performance Testing Effective

Three patterns separate effective testing from theatrical.

Clean modern flat infographic on light gray background. Top title bold black: THREE PERFORMANCE PATTERNS. Single vertical numbered list with three rows. Row 1 blue badge BUDGETS BLOCK MERGES with subtitle PREVENT REGRESSION. Row 2 green badge REAL USER MONITORING with subtitle SYNTHETIC INSUFFICIENT. Row 3 orange badge OPTIMIZATION ITERATIVE with subtitle MEASURE OPTIMIZE REPEAT. Footer text dark gray: EFFECTIVENESS THROUGH DISCIPLINE. Each label appears exactly once. No duplicated text.
Three patterns that make performance testing effective. Performance budgets blocking merges, real user monitoring, and iterative optimization all matter; without these, performance testing produces reports while regressions ship and users experience slow apps.

Pattern 1, budgets block merges. Block merges prevent regressions; without blocking, regressions accumulate.

Pattern 2, real user monitoring. Synthetic insufficient; real users reveal real issues.

Pattern 3, optimization iterative. Measure, optimize, repeat. Iteration compounds outcomes.

The combination produces effective performance testing. Without these patterns, testing becomes theatrical.

How To Improve Each Metric

Three patterns help improve metrics.

Pattern A, optimize images for LCP. Image optimization reduces LCP; biggest typical lever.

Pattern B, reduce JavaScript for INP. Less JS execution improves INP; biggest typical lever.

Pattern C, reserve image space for CLS. Image dimensions in HTML; prevents shifts.

Common Questions About Performance Testing

Performance testing raises questions worth addressing directly.

The first question is whether Lighthouse score 100 required. No; 90+ excellent. 100 often diminishing returns.

The second question is whether to test on slow connections. Yes; slow connections common globally. Test 3G simulation.

The third question is whether mobile performance differs from desktop. Yes substantially; test both.

The fourth question is how often to test. Per PR automated; weekly real user review.

How Performance Affects Business Outcomes

Performance affects business outcomes in compounding ways. Outcome effects compound across user base.

The first compounding effect is conversion rate. Faster apps convert better; conversion compounds revenue.

The second compounding effect is SEO ranking. Performance signal in ranking; ranking compounds traffic.

The third compounding effect is user retention. Fast apps retain better; retention compounds.

The combination produces business outcomes shaped by performance investment. Without investment, outcomes bounded by competitor performance.

How To Use AI For Performance Optimization

Three patterns help AI assist optimization.

Pattern A, AI analyzes Lighthouse reports. AI summarizes; summary identifies priorities.

Pattern B, AI suggests code optimizations. Specific optimizations from analysis.

Pattern C, AI explains performance tradeoffs. Tradeoffs informed by AI; informed decisions matter.

The combination produces AI assisted optimization. Without AI, optimization depends on senior developer time.

Common Mistake

The most damaging performance testing mistake is testing only on developer machines. Developer machines fast; users have slower devices and connections. The fix is to test on representative devices and connections; Lighthouse simulation, real device testing. Builders who test on developer machines ship apps slow for users; builders who test representatively ship apps fast for users.

The other mistake is treating performance as one off optimization. Performance regressions accumulate; ongoing testing required.

A third mistake is missing the real user monitoring. Synthetic Lighthouse different from real users; both required.

A fourth mistake is over optimizing without measurement. Premature optimization wastes time; measure first.

What This Means For You

Performance testing with Core Web Vitals and Lighthouse enables fast user experience and SEO ranking. The four metrics, implementation patterns, and sustainability approaches produce performance testing that compounds business outcomes.

  • If you're a senior dev: Performance fluency expected; learn Web Vitals deeply.
  • If you're an indie hacker: Performance affects conversions directly; investment compounds revenue.
  • If you're changing careers: Performance expertise valued; specialization differentiates.
Build performance testing skills

Browse more ship

Read more ship
PJ
Pranay Joshi

20+ years building products at scale. VP of Product & Engineering, startup founder, and AI coach. Helping dreamers turn ideas into reality with vibe coding.

Written forIndie Hackers

The Tuesday Shipping Report

Every Tuesday, one focused email:

  • - The tool or technique that's actually working right now
  • - A real problem from the community (and how to solve it)
  • - What changed this week in the vibe coding landscape

Read by 1,000+ founders, developers, and creators building with AI. Free forever. No spam.