Is React.js fast?
Faster than {framework}?
… or are there more relevant questions to be asking?

Jeff Barczewski
React Weekly
Published in
4 min readJul 16, 2015

--

I give training in React.js via CodeWinds, and one of the questions I’m often asked is whether it is faster than X?

The short answer is that React.js is very performant out of the box, even before you start tweaking.

Note that performance is always a tradeoff and one needs to be careful to optimize real use cases (e.g. time to render moderately complex screen) instead of artificial benchmarks (reorder 1000 items).

Even so, React.js has a great performance story. Its component model lets you easily optimize performance bottlenecks without changing the components’ interface. You’re free to apply manual optimizations to specific parts of your app without changing your whole approach. So if you need them, additional optimizations are available.

However, I don’t think those are even the best questions to be asking.

React.js is a pivotal technology that is moving the whole industry forward.

Why is it such a game changer?

  • Simplicity
  • Composable components
  • Declarative
  • Easy to use with existing projects
  • Functional / Immutable friendly

Facebook’s success in breaking from the mold and embracing bold ideas has raised the bar for everyone. It takes a leader to blaze the trail and prove out a technology before the mainstream will even take notice. Fortunately Facebook has just such an engineering team and leaders who embrace sharing this openly with the world.

There are always going to be new libraries or frameworks that will come up optimized for specific use cases that will be knocking on the doors wanting to take the new performance crown. So we have to be careful to not get caught up in chasing that carrot. It’s a never ending battle.

Performance does matter, but it’s only one of the factors to consider when choosing technology.

With the fantastic teams at Google, Mozilla, and Microsoft improving JS engine performance month after month, benchmarks and performance are constantly changing. Something that was faster last month, might not be the leader in the next. Fortunately, most everything is moving forward since general engine performance is improving across the board.

Another thing to consider is how closely does that micro-benchmark match your workload? Unless you have a real world environment and are tracking actual usage, it is hard to even dream up the proper things to evaluate.

Some alternate questions which I think might be better to ask are:

Developer Experience

  • Is React.js easy to learn so that my whole team can use it effectively?
  • How easy is it to evolve an existing code base? Not everyone is starting with fresh stack, so is it possible to ease into React.js or does it require a full rewrite?
  • How well do the React.js abstractions hold up when the codebase needs to be enhanced over time to support new features?
  • What type of Developer Experience (DX) does React.js provide?
  • What type of User Experience (UX) does React.js enable?

Stability & Resilience

  • How reliable and solid is React.js? Are we going to be constantly chasing bugs or weird anomalies?
  • Is it battle proven and receiving enough adoption to trust? Likewise, a smaller project doesn’t have the means to chase down edge cases across the multitude of browsers in use.

Community

  • Is the community welcoming and supportive?
  • Is React.js and its community forward thinking? Is it looking at the best ideas in the industry and moving towards those goals?

I think these types of questions are possibly more relevant to consider than the performance one.

… And I believe React.js nails it on every one of these.

In fact, it would be hard to find a UI library that has a better story than React.js with regards to all these key questions.

Even if we go back to the original performance question, React.js has an excellent position. Yes, it is very performant out of the box for the common use cases, but if necessary developers can tap into even more optimizations like shouldComponentUpdate and perhaps using immutable data structures to squeeze out additional speed. Without adding prohibitive complexity, developers have the confidence that they can optimize slow parts of their app if and when real use indicates performance enhancements are necessary and justified.

In my opinion, Facebook and the React.js community have set a new bar for UI development, one that now extends into mobile apps and all variety of devices (desktop, set top, …) as well. I believe history will hold a special place for this little UI library.

So be a part of the revolution. Join the React.js community. I think you’ll love it.

Some resources to get started with React.js

  • Main React.js site contains some great articles to get you started.
  • CodeWinds has continuing coverage of React.js and will host my forthcoming video course on React.js due this summer. Subscribe to be notified when it is available.

Many thanks to those that reviewed my article and provided feedback

--

--

Jeff Barczewski
React Weekly

Fullstack Web Developer, Node.js, Javascript, HTML5, Trainer, Publisher, Entrepreneur, Husband, Father, Genesis Ministry, Catholic Renewal, Skier, Conservative