r/angularjs • • Jun 01 '15

Is ReactJS really faster than AngularJS?

http://blog.500tech.com/is-reactjs-fast/
73 Upvotes

16 comments sorted by

22

u/chtulhuf Jun 01 '15

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 .

10

u/OutThisLife Jun 01 '15

The problem is that it's easy to write bad code

Like PHP!

4

u/ralusek Jun 02 '15

In PHP it's hard to write good code.

1

u/until0 Jun 02 '15

Is it ever good? I thought the best is ever reached was "not terrible."

0

u/[deleted] Jun 02 '15

[deleted]

3

u/Blimey85 Jun 02 '15

Some languages have ways to help prevent this, at least a little. For example "use strict" can help you not make bonehead mistakes in Perl and I think some other languages use that one as well.

2

u/m0okz Jun 02 '15

Javascript :)

2

u/OutThisLife Jun 02 '15

And Go. I love Go. Go is life.

1

u/OutThisLife Jun 02 '15

Haha, yeah.. I've seen some fucked up Python.

13

u/zomgwtfbbq Jun 01 '15

This validates what I've seen even with Angular - Angular handles a lot of data really well, but the browser chokes on massive DOM changes and/or huge DOMs in general. The only way to fix it is to simply not render pieces the user can't see and load more as they scroll. Only virtualizing things while you're changing them and then applying the changes en masse still doesn't solve the basic problem - your browser doesn't want to render 1,000 table rows.

6

u/[deleted] Jun 01 '15

angular 2 addresses the issues i believe. but even with angular 1, the performance issues are in rare areas

4

u/[deleted] Jun 02 '15 edited Jun 02 '15

Well, if you compare them like this, sure.

But angular isn't about making pages interactive (which is where react is good at), but about making webapps. Handling data across multiple pages and creating forms, doing data calls and whatnot.

Repeating data for tables or lists is something that React is pretty fast at, but i'd still rather work with Angular as it is much more readable, separates things the right way and is better for large projects with multiple people working on it.

Most of the comparisons are about a specific thing that one or the other might be better at, but i also see lots of em who use Angular wrong, or have some code that either entirely wrong or can be improved greatly. Just like the "track by $index" you see there.

I wanna see React devs make a big and difficult app, rather then an interactive page about listing data or charts or whatever. My first big Angular app was quite the ballbuster, but i've learned a lot and now i'm confident in making more apps like it. I feel that the current Angular structure and logic is much easier to use to cooperate and develop in large group whereas React is still quite a mess if i have to be honest. Mixing templates, styles, logic and structure in a way that has no real standard. Its one of the reasons jQuery and jQuery Mobile weren't doing it for me either. Not because it was slow and hard to get into, but because the endresult was very messy.

For me performance isn't the only reason for using a framework. And a single performance metric (which most tests are about, how well does the ng-repeat handle lots of data are 99% of the "performance comparisons") isn't why i use a framework at all. How easy is it to use, how easy is it to work on other peoples code and how well does it work with my building tools is of the same importance as how fast is it looping through data, how fast does it load and how fast can it change pages.

5

u/vt97john Jun 01 '15

I think this is an ad for JSBlocks

2

u/uberpwnzorz Jun 02 '15

yea, that pretty much got called out in the comments. but this article brings up good points of being mindful of what you're actually testing.

1

u/madou9 Jun 02 '15

Insightful, cheers for the link.

-15

u/ma-int Jun 01 '15

Na actual code samples plus links to "You need to sign up to view this".

No. Fuck you. Have a downvote.

8

u/eikaramba Jun 01 '15

wow..... clap .... just wow. Did you even looked at the article, because there ARE code samples... "oh no i need to look at the source code and i'm too lazy"