Comparing JavaScript Frameworks Performance Using Real-World Data

Rate this content
Bookmark

Google collects performance information from all sessions on opted-in Chrome browsers into its Chrome User Experience Report (CrUX) database. It then uses this information as a ranking factor for its search engine, but it also makes this information publicly available for everyone to view. I used this data to analyze and compare the performance of the leading JavaScript frameworks. In particular, I looked at the likelihood that websites built using each framework will have good Core Web Vitals (CWV) scores. Along the way I encountered several surprising results, and solved at least one mystery. See how your favorite framework ranks vs all the rest!

Dan Shappir
Dan Shappir
28 min
05 Jun, 2023

Comments

Sign in or register to post your comment.

Video Summary and Transcription

The choice of framework impacts website performance. Lab tests and field data are used to measure performance. Core Web Vitals are important metrics for performance evaluation. New frameworks that prioritize speed are emerging. MetaFrameworks like QUIC, SolidStart, Astro, and Nuxt show promise in improving performance. React frameworks like Gatsby and Remix perform well. Wix has a significant impact on React's performance. Framework choice significantly impacts the probability of building a fast website. Improvement is needed in framework performance.

1. Introduction to Web Performance and Frameworks

Short description:

Hello everybody, in this part, I will discuss how the choice of framework impacts the performance of websites and web apps. I'll use real-world data to compare the performance impact of leading JavaScript frameworks and meta-frameworks. Our choice of framework can have a huge impact on website performance. With so many frameworks and meta-frameworks available, it's important to choose the one that helps us build a fast website. To determine the best framework, we need to measure and compare them. The first method for measuring performance is lab tests.

Hello everybody, I hope you're enjoying the JS Nation conference. Today I'm going to talk about web performance, and specifically about how your choice of framework impacts the performance of the websites and web apps that you build. In order to do this, I'll be using real-world data to compare the performance impact of the leading JavaScript frameworks and meta-frameworks.

First though, a few words about myself. My name is Dan Shapir, and I'm the Performance Tech Lead at Next Insurance. We're an InsurTech unicorn aiming to revolutionize the way in which small businesses get insurance. And as everything is done online, it's critical that performance is as fast as possible. I'm also a host and panelist on the popular JavaScript Jabber Weekly podcast. I'm an invited expert on the W3C Web Performance Working Group where the performance metrics I will describe today are discussed and standardized. If you want to contact me about web performance or web development in general, you're welcome to do so on Twitter or Masterdon.

Speaking about web performance, we all know that building fast websites can be hard. And it's not just hard for you or me, it's hard for everybody. And that's the reason that according to Google, the majority of the websites it indexes do not have good performance. For this reason, when we select which tools to use for building websites, we want to choose tools that will set us up for performance success. Certainly, we don't want to choose tools that will set us up to fail. And probably the most important tool we choose as web developers, the most impactful item in our arsenal, is the framework we use. The reason for this is that when we build a website, it's the framework that's in the driver's seat. Our code is sitting in the back, telling the framework where to go and hoping that it takes us there. It's the framework that decides where and when to run our code, which parameters and state to pass to our code, what to do with the values our code provides to it, when to update the display, how to handle user interactions, etc. So, it's really not surprising that our choice of framework can have a huge impact on the performance of the websites we build with it.

Fortunately, these days we are spoilt for choice when it comes to deciding which framework to use. In fact, it seems like a new framework is being introduced almost on a daily basis. And what's more, a prime motivation for the creation of new frameworks is often web performance. They aim to enable us to build faster websites, more easily and consistently. In addition, there are a whole bunch of meta-frameworks implemented on top of these frameworks. For example, if you want to build websites using React, you can do so with Next.js or Emix or Gatsby or Astro and others. So the question is, which framework or meta-framework should we choose? The answer to that is that with all else being equal, we should prefer to use the framework that is the most likely to help us produce a fast website. But how can we know which framework that is? The answer to that is that we need to measure them and compare. There are two main methods for measuring performance on the web. The first method is known as lab tests.

2. Measuring Website Performance

Short description:

Measuring website performance can be done through lab tests or field data collection. Lab tests provide complete control and visibility, but can be challenging to set up and replicate scenarios. Field data involves collecting performance data from real user sessions, ensuring accurate measurements. Google's Chrome User Experience Database (CRUX) collects performance data from Chrome browser sessions and uses it as a ranking signal for search engine results.

This means measuring website performance in a controlled environment. Ideally, it should replicate the environments in which real users access our website. The main advantage of using this method is that it provides total control over the tests and complete visibility into the results. We can inspect every facet and behavior of our code and recreate it as required.

But lab tests are also difficult to do because setting up the lab environment can be challenging, and determining exactly which scenarios we should replicate can also be difficult. Lab tests are especially problematic when we want to compare performance of the various frameworks because we need to build the exact same applications using every framework we want to test. There are some tools that can help us automate this process, but significant time and effort may still be required.

The other approach that we can take is to use field data. That means collecting performance data from actual sessions of real users, preferably as many as possible. Random user measurements, or RUM for short, is about getting performance data from live sessions and using that data for the comparisons. This way, we can be certain that what we measure actually reflects what our users are experiencing. But how can we gain access to the performance data for all those sessions? Is it possible to instrument every website built using any framework so that it reports the performance data for every session, and then to collect this data into some sort of database so that we can generate comparisons?

Obviously, we cannot do something like that. But it turns out that someone can, and that someone is Google. That's because instead of instrumenting the websites, they instrumented the platform on which these websites run, the Chrome browser itself. Unless you opt out, the Chrome browser collects performance information about every session of every website that you visit and sends it up to Google Database in the cloud. This database is the Chrome User Experience Database, or CRUX for short. Google uses all this performance information that it gathers as a ranking signal for its search engine. That means that when Google decides how to order results in the search engine results page, it gives a ranking boost to pages that have better performance according to this data.

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
React is a library for "rendering" UI from components, but many users find themselves confused about how React rendering actually works. What do terms like "rendering", "reconciliation", "Fibers", and "committing" actually mean? When do renders happen? How does Context affect rendering, and how do libraries like Redux cause updates? In this talk, we'll clear up the confusion and provide a solid foundation for understanding when, why, and how React renders. We'll look at: - What "rendering" actually is - How React queues renders and the standard rendering behavior - How keys and component types are used in rendering - Techniques for optimizing render performance - How context usage affects rendering behavior| - How external libraries tie into React rendering
Building Better Websites with Remix
React Summit Remote Edition 2021React Summit Remote Edition 2021
33 min
Building Better Websites with Remix
Top Content
Remix is a new web framework from the creators of React Router that helps you build better, faster websites through a solid understanding of web fundamentals. Remix takes care of the heavy lifting like server rendering, code splitting, prefetching, and navigation and leaves you with the fun part: building something awesome!
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
Too much JavaScript is getting you down? New frameworks promising no JavaScript look interesting, but you have an existing React application to maintain. What if Qwik React is your answer for faster applications startup and better user experience? Qwik React allows you to easily turn your React application into a collection of islands, which can be SSRed and delayed hydrated, and in some instances, hydration skipped altogether. And all of this in an incremental way without a rewrite.
Full Stack Documentation
JSNation 2022JSNation 2022
28 min
Full Stack Documentation
Top Content
Interactive web-based tutorials have become a staple of front end frameworks, and it's easy to see why — developers love being able to try out new tools without the hassle of installing packages or cloning repos.But in the age of full stack meta-frameworks like Next, Remix and SvelteKit, these tutorials only go so far. In this talk, we'll look at how we on the Svelte team are using cutting edge web technology to rethink how we teach each other the tools of our trade.
React Concurrency, Explained
React Summit 2023React Summit 2023
23 min
React Concurrency, Explained
Top Content
React 18! Concurrent features! You might’ve already tried the new APIs like useTransition, or you might’ve just heard of them. But do you know how React 18 achieves the performance wins it brings with itself? In this talk, let’s peek under the hood of React 18’s performance features: - How React 18 lowers the time your page stays frozen (aka TBT) - What exactly happens in the main thread when you run useTransition() - What’s the catch with the improvements (there’s no free cake!), and why Vue.js and Preact straight refused to ship anything similar
SolidJS: Why All the Suspense?
JSNation 2023JSNation 2023
28 min
SolidJS: Why All the Suspense?
Top Content
Solid caught the eye of the frontend community by re-popularizing reactive programming with its compelling use of Signals to render without re-renders. We've seen them adopted in the past year in everything from Preact to Angular. Signals offer a powerful set of primitives that ensure that your UI is in sync with your state independent of components. A universal language for the frontend user interface.
But what about Async? How do we manage to orchestrate data loading and mutation, server rendering, and streaming? Ryan Carniato, creator of SolidJS, takes a look at a different primitive. One that is often misunderstood but is as powerful in its use. Join him as he shows what all the Suspense is about.

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.
Back to the Roots With Remix
React Summit 2023React Summit 2023
106 min
Back to the Roots With Remix
Featured Workshop
Alex Korzhikov
Pavlik Kiselev
2 authors
The modern web would be different without rich client-side applications supported by powerful frameworks: React, Angular, Vue, Lit, and many others. These frameworks rely on client-side JavaScript, which is their core. However, there are other approaches to rendering. One of them (quite old, by the way) is server-side rendering entirely without JavaScript. Let's find out if this is a good idea and how Remix can help us with it?
Prerequisites- Good understanding of JavaScript or TypeScript- It would help to have experience with React, Redux, Node.js and writing FrontEnd and BackEnd applications- Preinstall Node.js, npm- We prefer to use VSCode, but also cloud IDEs such as codesandbox (other IDEs are also ok)
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 🤐)
Master JavaScript Patterns
JSNation 2024JSNation 2024
145 min
Master JavaScript Patterns
Workshop
Adrian Hajdin
Adrian Hajdin
During this workshop, participants will review the essential JavaScript patterns that every developer should know. Through hands-on exercises, real-world examples, and interactive discussions, attendees will deepen their understanding of best practices for organizing code, solving common challenges, and designing scalable architectures. By the end of the workshop, participants will gain newfound confidence in their ability to write high-quality JavaScript code that stands the test of time.
Points Covered:
1. Introduction to JavaScript Patterns2. Foundational Patterns3. Object Creation Patterns4. Behavioral Patterns5. Architectural Patterns6. Hands-On Exercises and Case Studies
How It Will Help Developers:
- Gain a deep understanding of JavaScript patterns and their applications in real-world scenarios- Learn best practices for organizing code, solving common challenges, and designing scalable architectures- Enhance problem-solving skills and code readability- Improve collaboration and communication within development teams- Accelerate career growth and opportunities for advancement in the software industry