r/javascript • • Jun 01 '15

Is ReactJS faster than AngularJS ?

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

47 comments sorted by

View all comments

29

u/cgaudreau senior HTML9 engineer Jun 01 '15

I feel like this is desperate grasping at straws. It is theoretically possible to make Angular nearly as fast or faster than React is out-of-the-box, but the pain involved in doing so is massive. Yes, it's easy with little 5-line code snippets, but try doing so in a reasonably-sized application. It's hell.

React makes it easy to be fast by default. You generally don't even have to think about performance, and if you do have to, it is very easy to grasp. You don't need to frantically search extremely poor documentation.

How to optimize a React application: Implement shouldComponentUpdate. Or if you want performance by default, just use immutable data structures.

How to optimize an Angular application: Keep your scopes small. Keep it under 2000 watchers. Pollute your code with one-way bindings. Still no improvement? Oh, you need to do one-way binding here, too, in some obscure way. Don't watch functions. Don't watch objects. No $broadcast or $emit. Don't have big arrays. Should I use $digest or $apply? Why is this watcher causing the digest loop to take 500 ms to execute? No filtering or sorting unless you want to go mad. Did I mention using filters causes $index to be invalidated? How the hell do I even find out what's performing poorly?

I don't even know if any of that is correct anymore. It's too painful to remember. I want to be liberated and forget the literal hell that is Angular 1.x.

7

u/RankFoundry Jun 01 '15

Exactly. I don't see anyone doing any side-by-sides except with snippets or trival apps. Angular gets to be a real pain in the ass at scale.

3

u/perestroika12 Jun 01 '15

Which is confusing, because wasn't one of the original purposes of angular performant scalability?

3

u/chtulhuf Jun 01 '15

IIRC it originally was made to make forms easier

-1

u/RankFoundry Jun 01 '15

Yeah. Or at least a framework that was supposed to make SPA apps easy. I'd say it failed in the regard, unless you're building To-Do apps a lot.