browserbench, a collaborative initiative by Mozilla, Google and Apple, has released the version 3 of its browser performance benchmark suite called Speedometer 3.
As part of the things it measures, the suite includes a basic todo app implemented in different JavaScript frameworks. The choice of the framework is based on the popularity according to the HTTP Archive and the NPM monthly downloads. The announcement post on the WebKit blog gives more details about this choice.
Among the 12 different frameworks selected, we can find:
This new performance benchmarking suite is the perfect occasion to review the speed of Svelte and how it compares to its competitors.
Before going into the details, let’s make it clear. Using this benchmark suite to assess frameworks against each other is ultimately flawed! Even though the different versions of the todo app are functionally equivalent, their implementations differ. They were written to run as a suite on different browsers, not to be looked at individually.
If you inspect the code of these different versions, you will see that the approaches can vary.
Some of the TodoMVC implementations are “complex versions of these tests which are embedded into a bigger DOM tree with many complex CSS rules that more closely emulate the page weight and structure from popular webapps today.” The 6 complex DOM implementations concern:
There is another point to pay attention to. These benchnarks measure the runtime performance. There are other aspects to consider when assessing the speed of an app, such as loading time and Core Web Vitals.
For now, let’s accept that the result will have to be taken with a pinch of salt.
I ran the benchmark on the following browsers:
On a MacBook Air from 2020 (M1, Sonoma 14.4 (23E214)), all in incognito tabs, with no other apps opened.
Svelte is the fastest framework overall, followed by Preact, the Web Components implementation and Lit.
The Web Components implementation is the only one from this top 4 that is not embedded in a complex DOM structure (see explanation above).
For the sake of exhaustivity, here are the graphs for the sub tests, with the description of what they do.
We could look into more details at these results, but as I said this suite wasn’t built for that purpose. Let’s not draw conclusions from these results.
I tend to be passionate/obsessed about performance, but there are, of course, other aspects to consider when choosing a framework such as the community behind it, the ease of hiring skilled engineers, the ecosystem, the documentation…
Also there are plenty more JavaScript frameworks that could be assessed for performance. I’m thinking specifically of Solid which claims their benchmark beat Svelte.
Any thoughts on these results?