Book Image

DART Essentials

Book Image

DART Essentials

Overview of this book

Table of Contents (16 chapters)
Dart Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Performance tips for AngularDart


In most use cases, AngularDart will run fast enough for you to not even notice that there is a framework under the hood. However, when dealing with large DOM trees such as tables or long lists (let's say thousands of DOM elements), you can get hit by Angular very hard.

The basic ideas behind optimization is that we want to reduce the number of expressions that Angular watches and try to keep the scope hierarchy shallow. Internally, Angular uses the so-called digest loop, which is executed every time a value in the model changes. It has to check all watched expressions and see whether they've changed, and if they did, it has to propagate the change further until there are no pending changes.

When we talked about scopes, we mentioned that some Angular directives create new scopes and when used inappropriately, they might have significant performance impact. That's why we'll take a look at some performance optimization tips that reduce the number of watched expressions...