evancz / react-angular-ember-elm-performance-comparison

Comparing performance of Elm, React, Angular, and Ember
BSD 3-Clause "New" or "Revised" License
91 stars 39 forks source link

Add react with redux #10

Open rogeriochaves opened 8 years ago

rogeriochaves commented 8 years ago

Hello,

I believe the react example was not being very fair for a few reasons:

1 - The TodoMVC React example is very old, it does not take advantages from newer features of the language (ES6) nor from react (pure functions, classes)

For example, it implements an Utils.extends instead of simply using Object.assign, which should be more performatic. It also uses React.createClass instead of ES6 classes or having functional components, which would be a more up to date standard.

2 - It is using a generic way of handling state, which wasn't thought for performance (also adds unnecessary stuff like generate uuids).

This makes it unfair to compete against angular 2 for example, which is a fully-fledged framework and have optimizations to the way it handles state. The most common scenario for react is to handle the state with redux, which leads to my next point.

3 - The current react example isn't the most common real-case scenario

Although react and redux are two entirely separate things, all projects I've personally known of that is using one is also using the other, with es6 and so on


So, the example I added that uses react + redux is based on @gaearon's egghead tutorials1, they use all new "community approved" tooling, also Dan always worry about performance. It is a little faster than previous optimized react:

captura de pantalla 2016-09-17 a las 10 50 08

Although the performance is not much greater, I feel it is import to keep this as an example in the benchmarks because it is closer to the real world and may gain performance improvements automatically simply because it is using newer syntax and tooling.