react-angular-ember-elm-performance-comparison icon indicating copy to clipboard operation
react-angular-ember-elm-performance-comparison copied to clipboard

React code is outdated

Open exogen opened this issue 8 years ago • 4 comments

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.

exogen avatar Aug 30 '16 18:08 exogen

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?

evancz avatar Aug 30 '16 18:08 evancz

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.

exogen avatar Aug 30 '16 19:08 exogen

@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:

DestyNova avatar Sep 09 '16 22:09 DestyNova

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

leshow avatar Sep 12 '16 21:09 leshow