React - Lighthouse Performance audits - Deepstash
React - Lighthouse Performance audits

React - Lighthouse Performance audits

Curated from: web.dev

Ideas, facts & insights covering these topics:

12 ideas

·

489 reads

4

Explore the World's Best Ideas

Join today and uncover 100+ curated journeys from 50+ topics. Unlock access to our mobile app with extensive features.

The metrics measured

        Name - Weight in score - Summary

  1. First Contentful Paint (FCP) - 10% - Time to paint the first text or image
  2. Time to Interactive (TTI) - 10% - Necessary time for the app to become fully interactive (responding within 50ms from user interaction)
  3. Speed Index (SI) - 10% - How fast the content inside the page is visible populated
  4. Total Blocking Time (TBT) - 30% - Sum of all periods between FCP and TTI, when the task exceeds 50ms
  5. Largest Contentful Paint (LCP) - 25% - Time for the largest image or text to be painted
  6. Cumulative Layout Shift (CLS) - 15% - Movement of visible elements

6

368 reads

Short notices

 Some of the values are calculated based on 

data from the HTTP Archive

If you don't have a very specific reason to optimise only one of the metrics, the best approace would be to check the opportunities mentioned in the Lighthouse report and read an in-depth presentation 

here

5

21 reads

FCP

Very important for this part is the font load time. For faster load, it can be used the font-display: swap. This will make the site to render the default font and when the loading is done, the font will be changed. Also, you can preload the fonts. 

6

16 reads

TTI

It measures how long it takes a page to become fully interactive. A page is considered fully interactive when:

  • The page displays useful content, which is measured by the  
  • Event handlers are registered for most visible page elements, and
  • The page responds to user interactions within 50 milliseconds.

To improve this metric, you should consider 

reducing JavaScript payloads with code splittingapplying the PRPL pattern

Also, other things that can be helpful: 

minimize main thread work

and 

reduce JavaScript execution time

5

16 reads

TTI - PRPL Pattern

PRPL is an acronym that describes a pattern used to make web pages load and become interactive, faster:

  • Push (or preload) the most important resources.
  • Render the initial route as soon as possible.
  • Pre-cache remaining assets.
  • Lazy load other routes and non-critical assets.

5

12 reads

Speed Index

While anything you do to improve page load speed will improve your Speed Index score, addressing the following should have a particularly big impact:

Minimize main thread work
Reduce JavaScript execution time
Ensure text remains visible during webfont load

5

7 reads

More about TBT

TBT measures the total amount of time that a page is blocked from responding to user input, such as mouse clicks, screen taps, or keyboard presses. The sum is calculated by adding the blocking portion of all 

long tasksFirst Contentful PaintTime to Interactive

5

6 reads

How to improve TBT

Try to diagnose the root cause of long tasks, using 

What is causing my long tasks?

In general, the most common causes are:

  • Unnecessary JavaScript loading, parsing or execution. This means the main thread is doing more work than it supose to do -> try reducing JS payloads with code splitting, removing unused code and efficiently loading third-party JavaScript
  • Inefficient JS statements -> avoid selectors that returns 2000 nodes (e.g. document.querySelectorAll('a') ) and refactor to have a more specific one.

5

3 reads

More about LCP

This approximates when the main content of the page is visible to the users. 

The elements that are taken into consideration for Largest Contentful Paint: 

  • <img> elements
  • <image> elements inside an <svg> element
  • <video> elements (the poster image is used)
  • An element with a background image loaded via the   
Block-level

In the future, additional elements might be added, like <svg> and <video>

Extra info: 

LCP

5

15 reads

How to improve LCP

Causes: 

  • Slow server response times
  • Render-blocking JavaScript and CSS
  • Resource load times
  • Client-side rendering

For improvements, some relevant techniques:

Apply instant loading with the PRPL pattern
Optimizing the Critical Rendering Path
Optimize your CSS
Optimize your Images
Optimize web Fonts
Optimize your JavaScript

5

11 reads

CLS

CLS is a measure of the largest burst of layout shift scores for every 

unexpected

How to improve:

  • Always include size attributes on your images and video elements, or otherwise reserve the required space with something like
CSS aspect ratio boxes
  • Never insert content above existing content, except in response to a user interaction. This ensures any layout shifts that occur are expected.

5

6 reads

CLS - part 2

  • Prefer transform animations to animations of properties that trigger layout changes. Animate transitions in a way that provides context and continuity from state to state.

More info: 

here

5

8 reads

IDEAS CURATED BY

teni

Normal person with peculiar dreams @unkl's protégé @cristianmezei's disciple

Teni 🖖's ideas are part of this journey:

Product Management Essentials

Learn more about computerscience with this collection

Essential product management skills

How to work effectively with cross-functional teams

How to identify and prioritize customer needs

Related collections

Similar ideas

Read & Learn

20x Faster

without
deepstash

with
deepstash

with

deepstash

Personalized microlearning

—

100+ Learning Journeys

—

Access to 200,000+ ideas

—

Access to the mobile app

—

Unlimited idea saving

—

—

Unlimited history

—

—

Unlimited listening to ideas

—

—

Downloading & offline access

—

—

Supercharge your mind with one idea per day

Enter your email and spend 1 minute every day to learn something new.

Email

I agree to receive email updates