2020-08

Just how much faster is vanilla JS than frameworks ? by Chris Ferdinandi ( https://fediverse.org/ChrisFerdinandi )

A few months ago in a private Slack channel I’m in, Jeremy Wagner mentioned that he’d run some performance tests on React vs. Preact vs. vanilla JS, and promised to write about the results.

Last week, he finally wrote about his experiment, and the results, in an article on CSS Tricks .

The full results are really interesting, but here’s the quick overview of what he found:

  • Preact initially renders the UI 3-4x faster than React.

  • Vanilla JS initially renders the UI anywhere from 5-10x faster than Preact, and about 30x faster than React!

  • Handling UI state changes with vanilla JS is also orders of magnitude faster than using Preact or React.

You should absolutely go read the whole thing and dig into the results. It’s fascinating!

For me, the takeaways are clear:

  • If you can get away with just vanilla JS, it will give you the best experience, period .

  • If you need state-based UI, Preact is not just smaller than React, but far more performant, too.