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

React code is outdated #6

Open exogen opened 8 years ago

exogen commented 8 years ago

I don't mean to be "that guy" and nitpick the benchmarked code, but... I'm gonna be.

The TodoMVC React code was written for an old version of React. If you actually pop it open and try using it, it throws an error (try editing an item). React.findDOMNode hasn't been a thing since React 0.13; that should be changed to ReactDOM.findDOMNode.

Hand-optimized React 15 code would also switch all the components from React.createClass to extending React.Component, which is the new hotness and (AFAIK) renders faster. This would necessitate adding another Babel transform to the React demo.

evancz commented 8 years ago

I just got it from the http://todomvc.com website. I got the code a few weeks ago, so it was 15.1.0 at the time. Did best practices change in such a short time is the whole React community on 15.3.1 now and doing it the new way?

exogen commented 8 years ago

Yeah, not saying it's your fault, rather that TodoMVC is outdated. :)

React itself may have been at 15.1.0, but if you check out the package.json in the TodoMVC react example, it's still at 0.13.x and that's what the example code targets.

DestyNova commented 8 years ago

@exogen Could you do a minimal update to the latest React way of things and do a PR? I'd try but have absolutely zero knowledge of React :grin:

leshow commented 8 years ago

It doesn't seem like a fair comparison when the react code isn't idiomatic and has deprecated calls in it. The results are also odd since React beats Angular 1 in many other benchmarks (even old ones) yet somehow in this benchmark it is slower than Angular 1.

https://auth0.com/blog/updated-and-improved-more-benchmarks-virtual-dom-vs-angular-12-vs-mithril-js-vs-the-rest/

https://www.codementor.io/reactjs/tutorial/reactjs-vs-angular-js-performance-comparison-knockout