r/reactjs • u/murkin • Jun 01 '15
Is ReactJS really fast ?
http://blog.500tech.com/is-reactjs-fast/5
u/chtulhuf Jun 01 '15
Cross posting:
The real problem with Angular is not that it is inheritly slow. The problem is that it's easy to write bad code that makes it slow.
People who read angular performance docs would not do these mistakes. React's advantage is that you can read less and still have less performance issues.
Source: 2 years with angular and love it. Still, appreciate the fact that react is a great framdwoek that learned from the issues that angular has.
1
u/renren89 Jun 01 '15
Read the article this morning and always wondered the actual performance difference between the two but I somewhat find the depth of the reading a little short. The comments arguably talk a lot the concept of coding in react vs angular but I have shorter experience in web dev to understand it without a full depth article.
1
u/Chesh Jun 02 '15
https://news.ycombinator.com/item?id=9638305
More insightful comments on HN. Author of the original article seems to be missing the point of React in focusing on speed first.
18
u/blaine_hatab Jun 01 '15 edited Jun 01 '15
The jsblocks library authors are being incredibly deceitful with the tests they are showing off. Their entire premise is that they are faster than react but their tests are just manipulated.
They posted this up on product hunt, http://www.producthunt.com/posts/jsblocks, and at that point it claimed to be at 800ms on initial load where as react had 1250ms. I checked out the react code and there was a hidden input that was being rendered with every td element on the table. React has very heavy inputs which is why you are supposed to use state.
original test (with hidden td elements) js blocks: 800ms react: 1250ms
After removing hidden element jsblocks: 350-400ms react: 200-350ms
So yes, jsblocks can render a lot more input elements that you shouldn't be using faster than react. The react team explains why the inputs are fairly heavy when rendering a large amount, https://github.com/facebook/react/issues/3771
They didn't stop there though and they responded to my claims and came back with a new test. This time they just ramped up the number of data points by double and added an extra td element to make it an unreasonable absurd amount of elements.
revised test (original test of 5000 elements to 18000 elements) jsblocks: 600ms (they posted 700ms, so ill give them that) react: 700ms (they posted 950ms)
After removing half of the data to about 9000 elements react already started to tie jsblocks jsblocks: 450ms react: 450ms
Going down to about 5000 elements jsblocks: 250ms react: 200ms
Whether or not there is any merit to this library, you can't just go claiming that you have the fastest library so audaciously like this blog post and their marketing. It's terrible for the community. There are an absurd amount of javascript libraries and getting devs to push a few key frameworks forward is already difficult enough. And if you are going to add another library to the list, at least be able to back up your claims.
I will admit that jsblocks seems to be better at rendering extremely large amounts of tabular data, but that is never an issue for me and you should be using lots of different techniques to mitigate that anyway. But once you get to realistic scenarios react is still faster and comes with tons of other advantages.
I didn't test the angular one because I don't know enough to spot odd code, but without even looking into the code the fact that angular was the only one that didn't have a minified library seems fishy. It's at 900+kb compared to the jsblocks/react at 125ish kb. To me it seems like since status qua is react is faster and angular is slower, they just constructed these tests to make it 3. angular, 2. react, 1. jsblocks (the fastest library ever!!).
So there's my rant. Please stop promoting your library like you are, it's just distasteful.