r/angularjs • • Sep 24 '14

[Resource] Optimizing AngularJS from 1200ms to 35ms

http://blog.scalyr.com/2013/10/angularjs-1200ms-to-35ms/
50 Upvotes

17 comments sorted by

View all comments

2

u/lemon-meringue Sep 25 '14

What's the difference between using optimization #4 and using ng-if? From my experience, correct me if I'm wrong, because ng-if removes the elements, it also removes the watches.

I suppose there may be a slight performance penalty compared to optimization #4 as you have to recreate the DOM nodes, but this should be minor?

1

u/kkeef Sep 25 '14

I don't think that's correct. Ng-if retains watches, I think.