Before we address this perplexing choice, let’s first identify the main aspects of Angular and React that we must consider:
- Suitability for projects of various sizes;
- Search engine optimization (SEO);
- Development speed.
AngularJS performance vs ReactJS performance
AngularJS 1.x (before Angular 2) makes changes directly in the DOM in the browser. But this may not be convenient for users with older computers or slow mobile devices, since updating the DOM directly can eat up a lot of CPU cycles and slow down applications. An AngularJS application may also get sluggish if we use too many bindings between the parts of the application, which can also cause it to use too much memory on a client’s device.
The ReactJS library boasts of implementing a very efficient approach to updating the DOM. The virtual DOM is a concept designed to increase app performance. The ReactJS creators at Facebook adapted the single-page application architecture to produce a low load on any device. They accomplished this by moving calculations from the client to the server. This is a serious shift from the old-fashioned thin server architecture when the client (the browser in the user’s device) was in charge of all computations. A thin server architecture is used in most front-end Model-View-Controller (MVC) frameworks, but was abandoned by React.
To improve the performance of the AngularJS framework, the developers of Angular copied this ReactJS philosophy and introduced a virtual DOM in Angular 2, acknowledging the power of the virtual DOM for single page applications.
Based on what we’ve said about the DOM, we can deduce that AngularJS 1.x is best suited for single-page applications that update their content only occasionally, while ReactJS and AngularJS 2 make it possible to change content continually in an app of any size.