Daily Brush for Website Speed: Embrace the Performance Budget Ritual

Rate this content
Bookmark

In this talk I will use the dental metaphor in order to introduce the performance budgets just like brushing teeth everyday to keep them clean and healthy you should do the same for your website by setting a performance budget and check it in every pull request in your pipelines, the target audience is mid-level to advanced, I will start by the example of the tooth decay and cleaning them then brushing them everyday as the dentist advice, then explain decay as the performance issue and performance budgeting is like the toothpaste and go from here with the different techniques that developers can do in order to prevent any loss in the performance wins they made.

This talk has been presented at React Day Berlin 2023, check out the latest edition of this React Conference.

Watch video on a separate page

FAQ

A web performance budget is a set of guidelines that restrict the size of a web page or its resources to ensure it performs well. It helps in preventing performance regressions affecting user experience and business goals by setting limits on metrics like load times, resource sizes, and the number of HTTP requests.

Just like dental hygiene requires regular maintenance to prevent problems, web performance needs continual attention to avoid regressions. Neglecting either can lead to issues that might not become apparent until they become severe, impacting overall health or user experience.

The two types of performance testing mentioned are synthetic testing (or lab testing) and Real User Monitoring (RUM, also known as field testing). Synthetic testing is consistent but not very accurate, while RUM provides real user data, making it highly accurate but not always free.

Tools for applying and monitoring a performance budget include Bundlesize, Webpack, Lighthouse CI for free options, and paid tools like SpeedCurve and Caliper. These tools integrate into development processes to help ensure performance targets are met without exceeding the set budgets.

Creating a performance budget involves measuring current site performance, setting specific performance goals based on metrics that are important to you, and then planning and fixing issues to meet these goals. Once satisfied with the performance, that benchmark can be set as your performance budget.

Making a performance budget stick involves integrating the budget into your development and deployment workflows so that it is enforced automatically. This includes setting concrete, actionable, and meaningful performance targets that align with business goals and making the budget visible and enforceable within the team.

If new features are degrading web performance, consider optimizing existing features, removing outdated or non-critical features, or rethinking the implementation of new features to ensure they don't impact critical performance metrics. Regularly testing and adjusting based on performance data is essential.

Real User Monitoring is crucial because it provides genuine insights into how real users experience your website, including data on geolocation, browser type, and internet connection. This accuracy helps in making informed decisions to optimize performance effectively.

Medhat Dawoud
Medhat Dawoud
13 min
12 Dec, 2023

Comments

Sign in or register to post your comment.

Video Summary and Transcription

This Talk provides an introduction to web performance and emphasizes the importance of setting performance goals and budgets. It explains the steps for creating and applying a performance budget and suggests various tools for performance budgeting. The Talk also highlights the need to make the performance budget concrete and meaningful, connect it to business goals, and integrate it into the development pipeline. It concludes by emphasizing the importance of maintaining performance and connecting with the speaker for more information.

1. Introduction to Web Performance

Short description:

Hi, everyone. My name is Ned Haddawood, a senior software engineer working for Miro and a Google expert in web performance. Today, I'm going to take you on a journey to impress web performance budget rituals. Imagine the website as a human body, with performance being the teeth. The more you feed your website with new features, the more you need to care about performance. Just like bad teeth, performance problems may not be immediately noticeable, but they can greatly impact your experience. So let's get started.

Hi, everyone. My name is Ned Haddawood. I'm a senior software engineer working for Miro and a Google expert in web performance. Today, I'm going to get you on a journey to impress web performance budget rituals. But before that, let's imagine together if the website is like the human body. Human body is growing up by eating food. The more you're eating food, the more you need to brush your teeth, the more you need to floss your teeth on a daily basis, right?

If you imagine the website is like a human body, I imagine performance as your teeth. So the more you are feeding your website with new features, the more you need to care about performance. The similarity between both of them, if you have a problem in teeth, you're visiting a dentist to fix it for you. If you have a problem in performance, you might visit or hire a performance expert to fix it for you. Both of them cannot be fixed because with a smaller check-in inspection, you will find out that you were not caring too much about them.

Some people might argue and say, Well, we are not doing that and turns out just fine. Just like these two gentlemen. But here are two facts. First of all, bad teeth are working too. You can eat on bad teeth, but believe me, you're not going to enjoy food. The other fact is that you don't know for how long you're not going to suffer from a problem from your teeth or your performance. It might take a long time until you find out a lot of problems jumping in. So the sooner you are acting, the better. So let's jump on.

2. Measuring Performance and Setting Goals

Short description:

If you have a problem, the first thing to do is to measure it to understand its magnitude. There are two types of performance measurement: synthetic testing and real user measuring. Synthetic testing is consistent and free, but not super accurate. Real user measuring provides accurate data but may not always be free. By using both methods, we can measure various metrics and set performance goals based on research thresholds and recommendations. It's important to differentiate between performance goals and performance budgets. If you encounter performance issues, it's crucial to address them and demonstrate their impact on the online business. Suggesting a performance sprint and focusing on enhancing performance can yield positive results.

If you have a problem. The first thing to do is to measure this problem to just see how big or small this problem so you can act on.

So measuring performance, we have two types of measuring performance. The first one is synthetic testing, also known as lab testing using something like Lighthouse. It has some benefits and has some bad things. The good thing is that it's very consistent and it's free and it's handy. Just easy to do, but it's not super accurate. This is a problem. Why is this not super accurate? Because it depends pretty much on the machine that we are running on.

The other type is RAM testing, real user measuring, or also known as fill testing. This is more interesting for us today. And this is coming with real user, plug in, opt in, and we're getting bunch of information about them that will help us take more and better decisions. It's like geolocation, browser and time, Internet connection, and so on. It's very accurate and we can rely on it, but it's not always free. One free option could be the Chrome User Experience Report. But other paid options, like Calibre, Speedcurve, and so on, are totally worth it as well. As you can see in a bit.

So, using both of them you can measure a lot of metrics that are very useful for us to measure performance and to decide whether our website is performant enough or not. They came as well with some research thresholds and recommendations. For example, in front of us, three recommendations based on the core web vitals. For the LCP for example, we need to make it under 4 seconds at least to make it work fine. And 2.5 seconds is a recommendation for a good experience for the user. This is very useful to set your performance goal. And there is difference between performance goal and performance budget as we will see in a bit.

So, you have a problem, you went to the manager and say, Hey, we have a serious problem in our performance. We have performance issues. Just said, alright, we can postpone it after the next quarter future, right? He showed the number. This is not affecting the business, right? But it is, of course, affecting your business, online business. And you suggest to make a performance sprint for the whole team focusing on performance to enhance it. You did a good job, you and your team, and you turned everything to be green.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

A Guide to React Rendering Behavior
React Advanced Conference 2022React Advanced Conference 2022
25 min
A Guide to React Rendering Behavior
Top Content
This transcription provides a brief guide to React rendering behavior. It explains the process of rendering, comparing new and old elements, and the importance of pure rendering without side effects. It also covers topics such as batching and double rendering, optimizing rendering and using context and Redux in React. Overall, it offers valuable insights for developers looking to understand and optimize React rendering.
Speeding Up Your React App With Less JavaScript
React Summit 2023React Summit 2023
32 min
Speeding Up Your React App With Less JavaScript
Top Content
Watch video: Speeding Up Your React App With Less JavaScript
Mishko, the creator of Angular and AngularJS, discusses the challenges of website performance and JavaScript hydration. He explains the differences between client-side and server-side rendering and introduces Quik as a solution for efficient component hydration. Mishko demonstrates examples of state management and intercommunication using Quik. He highlights the performance benefits of using Quik with React and emphasizes the importance of reducing JavaScript size for better performance. Finally, he mentions the use of QUIC in both MPA and SPA applications for improved startup performance.
React Concurrency, Explained
React Summit 2023React Summit 2023
23 min
React Concurrency, Explained
Top Content
Watch video: React Concurrency, Explained
React 18's concurrent rendering, specifically the useTransition hook, optimizes app performance by allowing non-urgent updates to be processed without freezing the UI. However, there are drawbacks such as longer processing time for non-urgent updates and increased CPU usage. The useTransition hook works similarly to throttling or bouncing, making it useful for addressing performance issues caused by multiple small components. Libraries like React Query may require the use of alternative APIs to handle urgent and non-urgent updates effectively.
The Future of Performance Tooling
JSNation 2022JSNation 2022
21 min
The Future of Performance Tooling
Top Content
Today's Talk discusses the future of performance tooling, focusing on user-centric, actionable, and contextual approaches. The introduction highlights Adi Osmani's expertise in performance tools and his passion for DevTools features. The Talk explores the integration of user flows into DevTools and Lighthouse, enabling performance measurement and optimization. It also showcases the import/export feature for user flows and the collaboration potential with Lighthouse. The Talk further delves into the use of flows with other tools like web page test and Cypress, offering cross-browser testing capabilities. The actionable aspect emphasizes the importance of metrics like Interaction to Next Paint and Total Blocking Time, as well as the improvements in Lighthouse and performance debugging tools. Lastly, the Talk emphasizes the iterative nature of performance improvement and the user-centric, actionable, and contextual future of performance tooling.
Optimizing HTML5 Games: 10 Years of Learnings
JS GameDev Summit 2022JS GameDev Summit 2022
33 min
Optimizing HTML5 Games: 10 Years of Learnings
Top Content
PlayCanvas is an open-source game engine used by game developers worldwide. Optimization is crucial for HTML5 games, focusing on load times and frame rate. Texture and mesh optimization can significantly reduce download sizes. GLTF and GLB formats offer smaller file sizes and faster parsing times. Compressing game resources and using efficient file formats can improve load times. Framerate optimization and resolution scaling are important for better performance. Managing draw calls and using batching techniques can optimize performance. Browser DevTools, such as Chrome and Firefox, are useful for debugging and profiling. Detecting device performance and optimizing based on specific devices can improve game performance. Apple is making progress with WebGPU implementation. HTML5 games can be shipped to the App Store using Cordova.
Power Fixing React Performance Woes
React Advanced Conference 2023React Advanced Conference 2023
22 min
Power Fixing React Performance Woes
Top Content
Watch video: Power Fixing React Performance Woes
This Talk discusses various strategies to improve React performance, including lazy loading iframes, analyzing and optimizing bundles, fixing barrel exports and tree shaking, removing dead code, and caching expensive computations. The speaker shares their experience in identifying and addressing performance issues in a real-world application. They also highlight the importance of regularly auditing webpack and bundle analyzers, using tools like Knip to find unused code, and contributing improvements to open source libraries.

Workshops on related topic

React Performance Debugging Masterclass
React Summit 2023React Summit 2023
170 min
React Performance Debugging Masterclass
Top Content
Featured WorkshopFree
Ivan Akulov
Ivan Akulov
Ivan’s first attempts at performance debugging were chaotic. He would see a slow interaction, try a random optimization, see that it didn't help, and keep trying other optimizations until he found the right one (or gave up).
Back then, Ivan didn’t know how to use performance devtools well. He would do a recording in Chrome DevTools or React Profiler, poke around it, try clicking random things, and then close it in frustration a few minutes later. Now, Ivan knows exactly where and what to look for. And in this workshop, Ivan will teach you that too.
Here’s how this is going to work. We’ll take a slow app → debug it (using tools like Chrome DevTools, React Profiler, and why-did-you-render) → pinpoint the bottleneck → and then repeat, several times more. We won’t talk about the solutions (in 90% of the cases, it’s just the ol’ regular useMemo() or memo()). But we’ll talk about everything that comes before – and learn how to analyze any React performance problem, step by step.
(Note: This workshop is best suited for engineers who are already familiar with how useMemo() and memo() work – but want to get better at using the performance tools around React. Also, we’ll be covering interaction performance, not load speed, so you won’t hear a word about Lighthouse 🤐)
Building WebApps That Light Up the Internet with QwikCity
JSNation 2023JSNation 2023
170 min
Building WebApps That Light Up the Internet with QwikCity
Featured WorkshopFree
Miško Hevery
Miško Hevery
Building instant-on web applications at scale have been elusive. Real-world sites need tracking, analytics, and complex user interfaces and interactions. We always start with the best intentions but end up with a less-than-ideal site.
QwikCity is a new meta-framework that allows you to build large-scale applications with constant startup-up performance. We will look at how to build a QwikCity application and what makes it unique. The workshop will show you how to set up a QwikCitp project. How routing works with layout. The demo application will fetch data and present it to the user in an editable form. And finally, how one can use authentication. All of the basic parts for any large-scale applications.
Along the way, we will also look at what makes Qwik unique, and how resumability enables constant startup performance no matter the application complexity.
Next.js 13: Data Fetching Strategies
React Day Berlin 2022React Day Berlin 2022
53 min
Next.js 13: Data Fetching Strategies
Top Content
WorkshopFree
Alice De Mauro
Alice De Mauro
- Introduction- Prerequisites for the workshop- Fetching strategies: fundamentals- Fetching strategies – hands-on: fetch API, cache (static VS dynamic), revalidate, suspense (parallel data fetching)- Test your build and serve it on Vercel- Future: Server components VS Client components- Workshop easter egg (unrelated to the topic, calling out accessibility)- Wrapping up
React Performance Debugging
React Advanced Conference 2023React Advanced Conference 2023
148 min
React Performance Debugging
Workshop
Ivan Akulov
Ivan Akulov
Ivan’s first attempts at performance debugging were chaotic. He would see a slow interaction, try a random optimization, see that it didn't help, and keep trying other optimizations until he found the right one (or gave up).
Back then, Ivan didn’t know how to use performance devtools well. He would do a recording in Chrome DevTools or React Profiler, poke around it, try clicking random things, and then close it in frustration a few minutes later. Now, Ivan knows exactly where and what to look for. And in this workshop, Ivan will teach you that too.
Here’s how this is going to work. We’ll take a slow app → debug it (using tools like Chrome DevTools, React Profiler, and why-did-you-render) → pinpoint the bottleneck → and then repeat, several times more. We won’t talk about the solutions (in 90% of the cases, it’s just the ol’ regular useMemo() or memo()). But we’ll talk about everything that comes before – and learn how to analyze any React performance problem, step by step.
(Note: This workshop is best suited for engineers who are already familiar with how useMemo() and memo() work – but want to get better at using the performance tools around React. Also, we’ll be covering interaction performance, not load speed, so you won’t hear a word about Lighthouse 🤐)
High-performance Next.js
React Summit 2022React Summit 2022
50 min
High-performance Next.js
Workshop
Michele Riva
Michele Riva
Next.js is a compelling framework that makes many tasks effortless by providing many out-of-the-box solutions. But as soon as our app needs to scale, it is essential to maintain high performance without compromising maintenance and server costs. In this workshop, we will see how to analyze Next.js performances, resources usage, how to scale it, and how to make the right decisions while writing the application architecture.
Maximize App Performance by Optimizing Web Fonts
Vue.js London 2023Vue.js London 2023
49 min
Maximize App Performance by Optimizing Web Fonts
WorkshopFree
Lazar Nikolov
Lazar Nikolov
You've just landed on a web page and you try to click a certain element, but just before you do, an ad loads on top of it and you end up clicking that thing instead.
That…that’s a layout shift. Everyone, developers and users alike, know that layout shifts are bad. And the later they happen, the more disruptive they are to users. In this workshop we're going to look into how web fonts cause layout shifts and explore a few strategies of loading web fonts without causing big layout shifts.
Table of Contents:What’s CLS and how it’s calculated?How fonts can cause CLS?Font loading strategies for minimizing CLSRecap and conclusion