Your App Crashes My Browser

This ad is not shown to multipass and full ticket holders
React Summit US
React Summit US 2025
November 18 - 21, 2025
New York, US & Online
The biggest React conference in the US
Learn More
In partnership with Focus Reactive
Upcoming event
React Summit US 2025
React Summit US 2025
November 18 - 21, 2025. New York, US & Online
Learn more
Bookmark
Rate this content

Memory leaks in JS are a blind spot for many (I'd guess most) web apps and we need to spread awareness. How to know if your app leaks memory in the wild (reporting API), how to find leaks (memlab by Facebook + my recorder extension) and how to fix them (usually the easiest).

This talk has been presented at JSNation US 2024, check out the latest edition of this JavaScript Conference.

FAQ

Developers can use tools like Memlab, Chrome DevTools with memory tabs, and the reporting API to detect memory leaks.

Memory leaks are more significant in mobile browsers due to limited memory, which can lead to crashes more quickly than on desktops.

Common sources include leftover objects and DOM nodes that are not properly garbage collected.

You can fix them by cleaning up event listeners in the componentWillUnmount lifecycle method or using the cleanup function in useEffect hooks.

Yes, because console logs retain memory objects, which can contribute to memory leaks.

Neglecting performance optimizations and allowing JavaScript payloads to grow unchecked is a common challenge.

We offer free articles, videos, courses, and tutorials on React for both beginners and professionals.

React was introduced in 2011 and has become essential for web and mobile app developers.

TypeScript allows you to write JavaScript the way you want, improving the development experience.

Memlab is an open-source command-line tool by Facebook that helps detect memory leaks by running scenarios and comparing memory snapshots.

 Stoyan Stefanov
Stoyan Stefanov
29 min
18 Nov, 2024

Comments

Sign in or register to post your comment.
Video Summary and Transcription
We asked co-sponsors to present React, an essential framework for web and mobile developers. TypeScript improves the development experience. Let's talk about the neglected topic of JavaScript leaks and how Chrome handles them. Leaks are easy to create, even for good developers. We crashed browsers due to memory leaks. Solution: fully reload the page after soft navigations. Today we have tools to fix leaks. The first step is admitting you have a problem. Use the reporting API to collect data on memory leaks. If you have a problem, it's not just a single leak. Debug and take memory snapshots. Load the page, perform an action, go back. Compare snapshots to find leaks. Use Memlab by Facebook to identify leaked objects. Memlab tells us memory is used, leaks are everywhere. Chrome extension helps with exporting actions to scenario.js file. 50 users already. Fixing memory leaks involves finding and nullifying unused objects. Spot the leak in a simple React component that adds event listeners. Removing the component leaves the listeners behind. In session two, adding a set interval creates additional listeners. Debugging with Memlab and using non-minified code and named functions helps identify the leaks. Solution: add a component. In React, frameworks provide ways to clean up after components are removed. Spotting a leak in uppercase spelling of mount. Hooks offer use effect to handle cleanup. A use effect allows you to return a function for cleanup. Spot the weird memory leak caused by console logs. Try the reporting API, check your framework, use null, and find your first leak. Memory leaks may be more significant on a mobile browser due to limited available memory. Differentiating between leaked memory and growing global state can be determined by the app's architecture. Checking for memory leaks on mobile can be done using dev tools and manual inspection or by using Puppeteer and the developer tools protocol for emulation. The lack of naming and bindings for anonymous functions in a codemark plugin is a potential area for improvement. Neglect and the excessive amount of JavaScript are common culprits for poor web performance. Facebook's experience with redesigning their website highlighted the need for tools to address the performance bottleneck caused by JavaScript. Throttling the CPU can be effective. Developers should set objects to null when they are no longer needed, allowing the garbage collector to clean up. Chrome DevTools provides options for detecting console log memory objects. WeakRefs and WeakMaps can be useful for cleaning up memory leaks. Integration with tools like MemLab can help regression test releases for memory leaks. We are still early in memory leaks tooling. Raising awareness about the problem is important. Lighthouse scores are not the sole indicator of a fast website. Additional testing and familiarity with Core Web Vitals are recommended.
Available in Español: Your App Crashes My Browser

1. Introduction to React and JavaScript Leaks

Short description:

We asked co-sponsors to present React, an essential framework for web and mobile developers. TypeScript improves the development experience. Let's talk about the neglected topic of JavaScript leaks and how Chrome handles them.

We asked some of our co-sponsors to present the framework. We're bringing free articles, videos, courses, and tutorials to help you learn all about React, whether you're a beginner or a pro. Introduced in 2011, the framework has become essential for web and mobile developers alike, enabling modern apps by look and function. And while other JS tools have expanded or revised its original notions, React's popularity is still the one to beat.

Did you know that TypeScript lets you write JavaScript the way you really want to? Explore the variety of Typescript courses we compiled from our speakers and collaborators and find out what you can do with this language and how it improves the development experience. Did you know that TypeScript lets you write JavaScript the way you really want to? Explore the variety of Typescript courses we compiled from our speakers and collaborators and find out what you can do with it.

After the coolest, trendiest topic of AI, let's go to the most neglected one of JavaScript and leaks. After the coolest, trendiest topic of AI, let's go to the most neglected one of JavaScript and leaks. After the coolest, trendiest topic of AI, let's go to the most neglected one of JavaScript and leaks. After the coolest, trendiest topic of AI, let's go to the most neglected one of JavaScript and leaks. So, anybody seen that screen? Maybe not in this type of projection. Imagine, that would be cool if there is some sort of astronomy presentation and suddenly Chrome crashes. Because I know it's Chrome behind all of this, of course. So, if you can't read it, it says, oh, snap. So, if you can't read it, it says, oh, snap. Because I know it's Chrome behind all of this, of course. Because I know it's Chrome behind all of this, of course. So, yeah, if you can't read it, it says, oh, snap. Out of memory. So, how many of you have seen this? Rarely, kind of, right? Because developers will use good computers and we rarely see this. But do you think anyone ever sees it? With your apps? How dare you? Never. How dare you? Well, you may be surprised. So, no one likes to see this. Because I know it's Chrome behind all of this. But you may be surprised. So, Nolan Lawson, a few years ago, he used a one-off tool called leak, in French. And expected the ten most popular SPAs. He basically was just clicking and going back to the home page. And lo and behold, ten out of ten have memory leaks. One of them even has 186 megabytes of leaks on a single interaction.

2. Memory Leaks and Tools for Fixing Them

Short description:

Leaks are easy to create, even for good developers. We crashed browsers due to memory leaks. Solution: fully reload the page after soft navigations. Today we have tools to fix leaks.

And these are the top ten apps with really good developers who work on them. So, it's not like we are lazy or sloppy. It's just leaks are easy to create.

All right. And a while ago I was working on kind of a famous social media site. So, we were trying to do the whole single-page app thing. And we figured out we have a problem. We crashed the user's browsers. Because we leaked memory. And where did we leak? I don't know. It's a big project. We didn't have good tools back then.

So, what was the solution? After 15 or so soft navigations, we just fully reloaded the page. Give the browser a chance to start over. Turn our SPA into an MPA. Just a moment. That was embarrassing. But, yeah. Today, things are different. Today we have tools. So, let's talk about...

So, this is the plan for today. First to figure out if we do have a problem. Because if it's more of a, I don't know, MPA, maybe not. Then try to figure out where the leaks are. And talk about some common patterns on how to fix them. Oh, about me. I'm currently a Red Sea web page test. A darling of the web performance community. Spent a bit of time on Facebook and Yahoo before that.

3. Addressing Memory Leaks with the Reporting API

Short description:

The first step is admitting you have a problem. Use the reporting API to collect data on memory leaks. If you have a problem, it's not just a single leak.

Doing web performance frontend optimizations. I wrote a bunch of books. This is my bestseller. I don't suggest you buy it. It's very, very old. Please don't. Then I wrote a bunch of others. Like maybe one of the first for React. Even the second edition. Please don't. It's already so out of date. But enough about me.

Let's talk about your application. So, the first step in addressing a problem is admitting that you have a problem. How do you know you leak memory? Well, luckily now we have the reporting API. It allows you to get data back from the browser whenever there is an out of memory crash in real life. So, you can stop guessing. Start collecting the data and see if you do have a problem. So, you can get, you know, those out of memory or responsive crashes. There's actually other things that you can get from the reporting API. Like if your users see a security violation, the CSP. If the browser sends any notes for deprecating features. And, okay. You discover that you do leak memory.

So, what are you going to do about it? Option A, call a friend. That's a person who knows all the secrets of the universe. And can dive into your app and unearth the leak. And then you go and fix it. And then everything's fine, right? No. The thing is, there's usually not a single leak.

4. Debugging and Memory Snapshots with Memlab

Short description:

Debug and take memory snapshots. Load the page, perform an action, go back. Compare snapshots to find leaks. Use Memlab by Facebook to identify leaked objects.

And even if you fix the one, the next one is just around the corner. So, the better option, start debugging and taking some memory snapshots.

So, the idea is to have three steps. You load the homepage or the initial page. Then you perform some sort of action, interaction. And then you go back to the initial state. Every time you cause the browser to garbage collect.

So, you use the memory tab in DevTools. And garbage collect, take a snapshot. And at the end, compare snapshots one and three. And see if there's any difference. Are there any objects left that shouldn't be there? And if that sounds hard or non-trivial, you're not alone.

So, luckily, we can have some help from some open source tools. So, there is this one called Memlab that I want to talk about by Facebook. It's a command line tool. It uses Puppeteer to do those three steps. Load the page, do interaction, go back. And then uses some intelligence. Not artificial, I don't think. To make an educated guess and educated diff between the snapshots. And tell you where you have leaks and what objects are leaked.

So, it's been using at Facebook. Even doing find some leaks in React itself. So, this is what it looks like. You run it. And then here are the top section. It tells you what happened. Here in section number 2, it tells you what it found. In this case, it found over a thousand leaking objects. But they're all the same kind.

5. Using Memlab for Memory Leak Detection

Short description:

Graphs represent memory usage. If it doesn't look right, there's a problem. Memlab detects leaks. Uses JavaScript scenario files for testing. Perform actions and go back. Example from a real-life Maps application.

So, it gives you kind of the path to find the first one. And maybe you'll find the other ones as well. So, those graphs represent the memory usage every step of the way.

So, ideally it should look something, something more. And then go back to the bottom. And if it doesn't, you have a problem.

So, this example that I just tested was something like this. Like you create 1024 diffs. Add them to the window. And never clean them up. So, this is what Memlab was able to detect.

So, Memlab uses these so-called scenario files. It's just a JavaScript file. At the very minimum, you have to implement three methods. One where to go. Then what to click or interaction. And then write something, anything that Puppeteer allows you to do. To perform an action.

And then, similarly, anything you want to do to come back. So, there's additional APIs for cookies for login state. If the app is behind a login. But that's the bare minimum.

So, this is a real example from a real life Maps application. That you'll rename nameless. So, you load the map. Then you click a button that says, show me hotels around here. And then you say, no, no, no, forget it. I'm going to go back. Clear the search. Go back to the initial state.

6. Fixing Memory Leaks and Common Patterns

Short description:

Memlab tells us memory is used, leaks are everywhere. Chrome extension helps with exporting actions to scenario.js file. 50 users already. Fixing memory leaks involves finding and nullifying unused objects.

And this is what Memlab tells us. This is the first step there was some memory used. Second step. And then the third we didn't go back to the beginning. So, all of this showing of hotels and stuff left some stuff behind. Leaks are everywhere. It's not our fault. We're not sloppy. We're not bad developers. Everybody does it.

So, if you rarely use Puppeteer, you're not familiar, it might be a little bit of curve to get off the ground. So, that's why I published one Chrome extension to help with that. So, there's a recorder panel in Chrome DevTools. And it's extensible. So, you can click around stuff and then export in a format that you like. By default it's exporting JSON Puppeteer and whatnot. So, my extension just lets you from your actions to export scenario.js file that can be used with Memlab. And I'm happy to announce I already have 50 users. So, there's 50 people who care about memory leaks. And it says featured. So, I guess it's all right to use. All right.

So, okay. You found the problem. So, how do you go about fixing it? Let's take a look at a few common patterns. In general, most of the times it's just some objects that are left over after they're no longer needed. So, most usually DOM nodes. In this case, you just have to find what's still hanging out in memory, assign null to it, and you're done. So, you can see here that signals to the garbage collection that this is no longer needed. And now can be safely removed.

7. Spotting and Fixing Leaks in React Components

Short description:

Spot the leak in a simple React component that adds event listeners. Removing the component leaves the listeners behind. In session two, adding a set interval creates additional listeners. Debugging with Memlab and using non-minified code and named functions helps identify the leaks. Solution: add a component.

Oh, let's play a game. Spot the leak. All right. So, we start with a simple React component. I know it's a class-based component, don't kill me. But for people who are not familiar with React or haven't looked at it lately, I think it makes more sense. It outputs some sort of content. Does something. And then when it is attached to the DOM, when it mounts, it adds an event listener and listens to key presses. That's why it's called Snoopy, because it snoops on everything you press. So, where is the leak? There's not too much code, so where could it be? Really? In this area. So, what's wrong with this? Okay. So, yeah. Basically when you remove Snoopy from the DOM tree, this listener will keep on listening, and this event listener will still be around.

Spot the leak, session two. Same thing, but we added a set interval. So, there's another listener that just counts time. Where's the leak? And when you remove, there's two listeners just hanging around. So, if you debug this with Memlab, if it's minified code, it's going to be horrible. You might not be able to see anything. So, that's why a good idea is to use non-minified code for debugging, and also to name the functions, right? Instead of anonymous functions, to use named ones. Anybody remember bind? Yeah. So, yeah. Now, when you gave names to our functions, non-minified code, named functions, using Memlab recorder, and then running Memlab with the Snoopy.js that was generated, and then we can look for stuff. And then, I don't know. That's kind of white. I don't know if you can see it, but our Snoopy key down and Snoopy interval are clearly visible there. You know where to look. So, how do we plug the leak in this case? Yeah. Well, we just add a component.

8. Unmounting and Cleanup in React

Short description:

We'll unmount and clean up after ourselves when we're done. In React, frameworks provide ways to clean up after components are removed. Spotting a leak in uppercase spelling of mount. Hooks offer use effect to handle cleanup.

We'll unmount and clean up after ourselves when we're done. Right? In this case, the event listener has to be accessible for both. Did mount and will unmount. So, yeah. Simple. So, this is React. Any framework that you use, there's got to be some sort of way to clean up after yourself after the component is removed, and we should benefit from those.

Spot the leak again. All right. So, this is what we just fixed that works, and this is a leak. I'll just switch back and forth and see if you can see the difference. Yeah. I wish I was making this up, but that's a real-life scenario, something that a memo lab was able to find out. It's just somebody decided because they're not using typing and stuff like this to spell mount with uppercase. I mean, it kind of makes sense. Component did mount is uppercase. Unmount, yeah. All this cleanup work is for nothing.

One more time with hooks. Right. So, that people are not disgusted by the class-based components. Right. Now we have use effect. Right. So, in this case, we do two things. One is the event listener, the key down, and one is the interval. They could be in the same use effect, but I know personally, I prefer to have one for each chunk of work. So, the leak is obviously, again, when the component is removed, some stuff still hangs out. How do we plug it? Well, a use effect allows you to return a function, and that is the cleanup that you do.

9. Plugging Leaks and Final Remarks

Short description:

A use effect allows you to return a function for cleanup. Spot the weird memory leak caused by console logs. Try the reporting API, check your framework, use null, and find your first leak.

How do we plug it? Well, a use effect allows you to return a function, and that is the cleanup that you do. So, yeah. Again, same thing. Return a function that cleans up after yourself. So, different API, class-based versus functional components, but still the same tools to clean up after.

Spot the leak again. Wow, that one's weird. Is this a memory leak? Yeah. Turns out it is. Turns out the console, you know, retains some references to the stuff it logs. And you can actually explore this in the memory tab in Chrome when you take a snapshot. Then you can filter by, you know, just things retained by the console. But, I mean, whoever puts console logs in production, right? No one ever.

To sum up, thank you very much for your attention. So, I don't want to be paranoid, but I think they're everywhere. Leaks, man, scary. And, yeah, when you come back tonight, that's the thing to do. Try the reporting API, then check whatever your framework of choice allows you. And just use null everywhere. Try Memlab and Memlab Scenario Recorder and see how that works for you. And that's some, you know, encouraging words in the end. As you can see, leaks are hard to find, but usually very easy to fix. Just assign null to things, clean up after, and just try to use the tools we have and find your first leak today. And this will make your users, if not happy, no one can guarantee happiness, right? At least a little bit less frustrated. And with that, I thank you very much. Yeah. Thank you very much. Just one second.

10. Web Performance and Memory Leaks

Short description:

I run an advent calendar called Web Performance Calendar, publishing articles related to performance. Reach from JavaScript to web performance. Share your stories and research. Chrome is everywhere, but no particular browser has more memory leaks than another.

Thank you very much. Just one second. Hang on, hang on. I was wondering if we have time, but I guess we do. So, I'm part of the web performance community, so is Andrei. And this is one of the things, like I run an advent calendar called Web Performance Calendar on the website called Perfplanet. So every December, we publish one article a day related to performance. A lot of it is front-end performance, because that's where most of the time is spent. And over the years, we have some fantastic, I mean, it's been running over ten years. Like there was an article about how React reconciliation works. That was very popular, because it wasn't documented anywhere. So, yeah, if you haven't, reach over from the JavaScript land to the web performance land, learn about the latest and greatest. And also, it's very open to – it's all community driven. So whoever sends me an article, I publish it. This is the editorial process. So, if you want to share a story, you want to share any type of story or research or anything you did, case study, I'll be happy to publish it. Awesome. Put your hands together again for Mr. Stefanov. Thank you.

Very early in the talk, you'd mentioned, you know, talked about leaks, and you said, of course, it's Chrome. I thought I heard that. Oh, about the planetarium, yeah, that was a bit of a joke. I don't know if it is, but Chrome is everywhere these days. Right, right, right. Bloomberg Terminal and other places, so I was just kidding. I wouldn't be surprised if this wonderful display is powered by a browser. Possibly. We know the browsers are in space, right? But, I mean, I'm going to get back to that real quickly. So, you know, is there, in your experience, have you seen a particular browser have more memory leaks than another for any particular reason at all? I don't think so.

QnA

Memory Leaks on Mobile and Identifying Leaks

Short description:

Memory leaks may be more significant on a mobile browser due to limited available memory. Differentiating between leaked memory and growing global state can be determined by the app's architecture. Monitoring the state's growth and looking for objects that are not garbage collected can help identify potential leaks. Checking for memory leaks on mobile can be done using dev tools and manual inspection or by using Puppeteer and the developer tools protocol for emulation.

Not so much. And since we're both in the performance space, would memory leaks be more significant, say, on a mobile browser than not? Oh, good one. Good one, yeah, well, I mean, the leak is going to be the leak, but when you have less amount of available memory, the sooner you crash the browser. So, yes. So, generally, having said that much, we should certainly pay even more attention, as you know, the world pretty much is on mobile more than not. That's true, yeah. Have I just inserted myself into your deck now, is that it?

Okay, let's get to some of these questions, because we definitely did get quite a few. And this one right here has been upvoted quite a bit. How can you tell the difference between leaked memory and growing global state? Oh, well, good one. Yeah, well, the growing global state, I guess that's more about how you architecture the app rather than silly little mistakes that make stuff just get lost, and not garbage collected properly. But you don't expect the garbage collector to take your state and wipe it out, right? So, yeah, I think that's more of an architecture kind of thing. Okay. So, yeah, if you know that, yeah, that's kind of a clue. That's going to be probably even easier than hunt for memory leaks is if you just have some sort of timer that looks at your JSON dump of all the state, and just sends beacons every once in a while, and see how the state grows, and if there's a cause for concern. I know at least one company, I don't want to, you know, they'll write probably for the calendar, so it's going to be awesome. But they know the object that they usually leak, so they know what they're supposed to clean up. So they have a custom build thing that runs every once in a while and checks. All of these are expected to be garbage collected. How many of them are not? So, yeah, these are kind of custom thing.

Where the memo app and stuff that I was showing is like, even if you don't know what's happening in the app at all, you just want to find stuff. Okay. Let's get to this question right here. Actually getting back to what I'd mentioned, but, you know, if you want to expand on that. Mark asked, how to check mem leaks on mobile? On mobile. So, yeah, I mean, you can use dev tools to connect to a phone, right? And, well, yeah. Yeah, you can manually inspect it, right? So mem lab is not going to happen in this case because it uses Puppeteer to connect to the Chrome dev tools. But if you want to, yeah, actually, yeah, you can run Puppeteer on some sort of emulation of the website. And if you have access to the developer tools, developer tools protocol, then, yeah, why not? All right. Thank you very much for that question, Mark. Let me see here.

Web Performance and Common Offenders

Short description:

The lack of naming and bindings for anonymous functions in a codemark plugin is a potential area for improvement. Neglect and the excessive amount of JavaScript are common culprits for poor web performance. Facebook's experience with redesigning their website highlighted the need for tools to address the performance bottleneck caused by JavaScript. Emulating having less memory is possible by slowing down the system.

There's another one. M asks, do you know if there's a codemark slash plugin that would add names and bindings to the anonymous functions automatically? Yeah, I don't. I think that was something that's got to exist there. I haven't looked. Or maybe that's one application of AI, just go and name my functions.

Okay. Let's go somewhere else here. What is the biggest and most common offender of web performance in your experience? Okay. Oh, tough one, tough one. Neglect, usually. Sometimes we fix things and everything's wonderful and fast, and then we check six months later and everything's back to what it was. Yeah, I mean, unfortunately, when it comes to web performance, the most common answer, it depends. It depends on the type of the app. But lately, not lately, it's been a trend for quite a while. It's just the sheer amount of JavaScript that we ship out there. It's a common issue. And that's why we needed tools like this, right?

Yeah. This was built by Facebook when there was a redesign from the kind of a sort of SBA to a completely full SBA. And the amount of JavaScript and execution was bottleneck number one, which is insane. Yeah. And I would imagine you could speak with experience, having seen what was going on at Facebook back then and what you see today. So it's still kind of comparable? Or what? In terms of like the issue? Oh, well, I don't debug Facebook issues anymore, so I cannot tell. But as a user trying to post on the Facebook marketplace with Firefox, they have work to do. Okay. I like this question actually here, coming from anonymous. Is there a way to emulate having less memory? You can memory. I can't remember. Yeah. You can slow down. Yeah, definitely.

Memory Leaks and Tools

Short description:

Throttling the CPU can be effective. Developers should set objects to null when they are no longer needed, allowing the garbage collector to clean up. Chrome DevTools provides options for detecting console log memory objects. WeakRefs and WeakMaps can be useful for cleaning up memory leaks. Integration with tools like MemLab can help regression test releases for memory leaks. No AI tools are known to remove memory leaks from code.

You can throttle the CPU. But that's a good one. We should talk to Chrome folks that are here. Yeah. And Addy's here too in terms of DevTools. So that might be a question for him. But great question, anonymous. Thank you.

Okay. We did that already. Can you expand on when a developer should set objects to null? Whenever you think you don't need it anymore, but it looks like it's going to be used, or whatever your tool says, okay, this thing is still around, and then you go and think, okay, why? Basically, everything you don't need, you should discard and give the garbage collector a chance. I'm going to get some water.

Okay. Here's a question. How to detect console log memory objects? Yeah. If you take a snapshot in Chrome DevTools in the memory tab, then you can look at it, and there's an option. It's kind of a newish one that you can filter only by things that are retained by the console. And also, don't console log in production right now. How useful are WeakRefs and WeakMaps for cleaning up memory leaks? Yeah. I really hope this company publishes this article, but that's exactly what they were using, WeakMaps, although MDN will tell you not to. Yeah. I think pretty useful. Are there CI tools to regression test releases for memory leaks? Yes. Yeah. I mean, you can integrate MemLab, and that's what we're doing at Facebook. It's on PR, diff, whatever you call it. You can run the tools and see if things have regressed, and yeah, it does actually run continuously. Okay. Another question that seems it would've been nice to even have – well, it's actually a nice connection between our last talk. Is there any AI tools that can not just detect leaks but can also remove them from your code? I'm not aware, no.

Memory Leaks and Lighthouse Scores

Short description:

We are still early in memory leaks tooling. Raising awareness about the problem is important. Lighthouse scores are not the sole indicator of a fast website. Additional testing and familiarity with Core Web Vitals are recommended.

But, yeah, I mean, it seems like it's probably out there already. No. But who knows? Yes, of course. I mean, how many? There's a top ten. Yeah, yeah. No, I think we're kind of very early in the memory leaks tooling, which is kind of unfortunate. So MemLab is one of the very few things that we have. Yeah. So, yeah, if we can teach like a linter or something to just go and make sure that the cleanup hooks are really used, that'd be cool. You don't even need AI for this.

Okay. You just link the whole check. You just said that we're pretty early in the tooling there. Is there a particular reason why? Well, because we ignore this problem because we don't see it. So part of why I'm here is just to raise awareness. Awesome, awesome. Because, you know, I mean, who sees that out-of-memory crash in normal life or in development with the latest Mac?

And this'll be our last question. But, again, this would be – it's almost a nice amalgam between this talk and the last one to an extent, anyhow. How far will Lighthouse reports get you? If you get nice scores on Lighthouse, is that your performance audit done or will it only get you halfway? I do like that question. Anonymous? Yeah. And we just came back with Anri from PerfNow, which is kind of our yearly web performance conference, where I think Lighthouse was kind of not the darling of the industry at this point. So, yeah, Lighthouse is a good place to start, but the scores really don't mean anything, right? It's just kind of a way to give you an incentive when you see a number to make it better. It's more useful for regression testing when you run it in continuous integration and see if the score went down. So it's kind of all relative. But, yeah, Lighthouse score of 100 doesn't mean you have a fast website. Lighthouse score of zero guarantees it pretty much. It definitely gives you an idea that things are relatively all right, but you still might want to do some additional testing to make sure everything's solid and whatnot. We can get into that another time. Folks who are not familiar with Core Web Vitals, go check them out and read about it. Yes. Yes. I mean, Stoyan's going to be around, so you'll be able to ask him quite a few more questions if you do want. And, as well, you know, there were a couple of questions around Lighthouse, I feel. I think Addy would have you some – Addy could add some insight, is what I'm trying to say with that being said. Stoyan. Yes. Thank you very much for this Q&A. Give it up again for Stoyan. Thank you.

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 2022React Advanced 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.
How React Compiler Performs on Real Code
React Advanced 2024React Advanced 2024
31 min
How React Compiler Performs on Real Code
Top Content
I'm Nadia, a developer experienced in performance, re-renders, and React. The React team released the React compiler, which eliminates the need for memoization. The compiler optimizes code by automatically memoizing components, props, and hook dependencies. It shows promise in managing changing references and improving performance. Real app testing and synthetic examples have been used to evaluate its effectiveness. The impact on initial load performance is minimal, but further investigation is needed for interactions performance. The React query library simplifies data fetching and caching. The compiler has limitations and may not catch every re-render, especially with external libraries. Enabling the compiler can improve performance but manual memorization is still necessary for optimal results. There are risks of overreliance and messy code, but the compiler can be used file by file or folder by folder with thorough testing. Practice makes incredible cats. Thank you, Nadia!
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
Watch video: Optimizing HTML5 Games: 10 Years of Learnings
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.
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.

Workshops on related topic

React Performance Debugging Masterclass
React Summit 2023React Summit 2023
170 min
React Performance Debugging Masterclass
Top Content
Featured 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 🤐)
Next.js 13: Data Fetching Strategies
React Day Berlin 2022React Day Berlin 2022
53 min
Next.js 13: Data Fetching Strategies
Top Content
Workshop
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 2023React Advanced 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 🤐)
Building WebApps That Light Up the Internet with QwikCity
JSNation 2023JSNation 2023
170 min
Building WebApps That Light Up the Internet with QwikCity
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.
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