Performance of Angularjs ng-Repeat on mobile device

Posted on Posted in Javascript

When developing mobile applications, performance is a key criteria to going native. But as hybrid apps get more popular, writing high-performance apps is crucial. As such, we’ve been constantly testing performance between different javascript approaches.

For this blog, we are showing the test results comparing performance of ng-repeat of Angularjs vs. standard DOM Manipulation.

The video above shows that performance of Angularjs is almost two times slower than standard DOM Manipulation. Angularjs responded within 526ms, while standard DOM manipulation responded within 310ms.

As reference, below are the code snippets used:

Angular.js

    
{{item.name}} {{item.price}}

Standard DOM Manipulation.

    this.executeQuery(pagedStmt, param.values, function(results) {
        var divHtml = "";
        var len = results.rowsReturned;
        var rows = results.rows;
        for (var i=0; i

The code above are snippets to explain the difference between approaches. However, they may not work with you as they are incomplete.

So, if you want to improve responsiveness of your hybrid app, consider rewriting loops that uses ng-repeat.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.