Can AngularJS be faster than React?

2 min read Original article ↗

Michael Vayvala

Short answer: yes and no

A while ago, I read a blog post that shows that Angular’s ng-repeat with “track by” is faster than React. I didn’t test it myself back then and when I needed to build a large table with a bunch of buttons using Angular, I thought that it shouldn’t be a problem, cause I can just use “track by” that will make the table render really quickly. Unfortunately that wasn’t the case, I faced a lot of rendering performance issues and “track by” barely made a difference.

After struggling for some time I decided to build this table using React. As expected, the table started to render 3 times faster than before. That inspired me to design a couple of use cases and test rendering performance of Angular, Angular with “track by” and React:

Rendering Data Table (1k rows)

This is very basic example. Table just needs to be populated.

GitHub
Angular demo
Angular with track-by demo
React demo

Re-rendering Data Table

In this example table data is updated every 20ms:

GitHub
Angular demo
React demo
Angular with track-by demo

Conclusion

Based on the rendering tests, Angular with track-by is faster for re-rendering the data-table and React is faster for initial rendering of the data-table.

If you face initial rendering performance issues with Angular, just combine Angular and React, there are many good ways to do that.