React Forum
Blog & Guide Responses
Jan 29, 2023 · 04:00 AM

web.dev: Web Vitals - discussion (2023-01-29)

Started by Keira Santos
externalweb-vitalsperformancelcpclsinprender budgetevidenceposture

The web.dev Web Vitals guide is one of the few performance resources that stays grounded in how pages feel. In this repo's vocabulary, it maps nicely to performance as posture: budgets, cadence, and making the user's experience visible through evidence rather than vibes.

Read the article

Do you actually log vitals in app code, or rely on external tooling only? What evidence do you render so perf issues can be debugged from screenshots/traces? How do you balance performance posture with correctness posture (freshness, re-renders, derived state)?

Comments (14)

Back to latest
Marisol Vega
Feb 02, 2023 · 10:10 AM

We log vitals in app code, but only in a "contract log" way (session id + route + posture).

The raw numbers without context are almost useless.

Dmitri Kline
Feb 08, 2023 · 04:04 AM

We emit a tiny perf log that ties vitals to route posture, so you can correlate spikes:

txt
[tips] vitals route=/dashboard lcp=2.4s inp=180ms cls=0.03 posture=warm cacheLane=cache
[tips] vitals route=/dashboard lcp=3.9s inp=410ms cls=0.12 posture=hot cacheLane=bypass reason=freshnessSwitch

The key is the reason + posture fields. Otherwise it's just numbers.

Lena Fischer
Feb 15, 2023 · 03:15 PM

Counterpoint: logging vitals from app code can distort results if it adds work.

We do a very small sample and keep everything else in external tooling.

Keira Santos
Feb 18, 2023 · 06:06 AM

Agreed. We treat it as evidence, not as analytics.

If the evidence costs too much, the evidence isn't worth it.

Grace McCoy
Feb 27, 2023 · 03:03 AM

The most practical thing for us was rendering a render-budget posture in the UI.

It turns perf from "we think" into "we decided".

Jasper Nguyen
Mar 12, 2023 · 10:22 PM

CLS got better once we stopped letting derived summaries reflow unpredictably.

We reserved space for card summaries and kept the derived shape stable (even if values were updating).

Nina Kapoor
Mar 28, 2023 · 11:11 AM

INP/interaction issues often came from too much work in one render tick. We introduced a cool tick posture and logged the tick window:

txt
[tips] tick=cool windowMs=10000 reason=batterySaver
Camille Duarte
Apr 19, 2023 · 07:19 PM

Counterpoint: you can chase vitals and accidentally ruin correctness.

We had to decide when freshness matters more than perf and encode it as posture.

Owen Price
May 08, 2023 · 08:08 AM

The biggest perf win was making the route shell stable and moving churn into derived cards that update predictably.

When the shell is stable, the page feels fast even when data is moving.

Benji Rios
May 27, 2023 · 04:44 AM

If you adopt evidence logs, beware of logging everything.

Only log transitions that map to user experience (posture, lane, identity).

Amina Farouk
Jun 21, 2023 · 12:12 PM

Docs tie-in: the perf docs in React Tips treat budgets and posture as first-class, which matches web.dev pretty well.

Related: Performance and Rendering (Best Practices) and The App Router Mindset.

Theo Bennett
Jul 14, 2023 · 02:14 PM

We also render a single "perf posture" badge in debug mode.

It prevents people from reporting perf bugs without mentioning the mode they're in.

Sofia Valdez
Aug 22, 2023 · 03:33 AM

LCP improved when we pre-derived the hero card output and avoided conditional layout swaps.

The output shape stayed constant; only values updated.

Tomas Rivera
Oct 11, 2023 · 11:11 AM

Counterpoint: sometimes the best fix is just less JS and less complexity.

Posture helps, but if the app is doing too much, posture won't save you.

Marisol Vega
Oct 14, 2023 · 04:04 AM

True. We used the vitals logs to find where complexity was real vs imagined.

Then we deleted things. The most underrated optimization.

Salma Qureshi
Dec 21, 2023 · 10:22 PM

VItals are useful because they force you to define what "good" means.

Once you define it, you can encode it as a contract and log it like everything else.