9. ● each variable in $scope is a watcher
● $digest is called on every change
● second $digest is called when a
change is found
AngularJS optimization
9
35. IE11 optimization
● Reduce reflow
35
elementA.className = "a-style";
var heightA = elementA.offsetHeight; // layout is needed
elementB.className = "b-style"; // invalidates the layout
var heightB = elementB.offsetHeight; // layout is needed again
elementA.className = "a-style";
elementB.className = "b-style";
var heightA = elementA.offsetHeight; // layout is needed and calculated
var heightB = elementB.offsetHeight; // layout is up-to-date (no work)
55. How to optimize?
To optimize the painting, the browser has to ensure that the animated CSS
property:
● does not affect the document’s flow,
● does not depend on the document’s flow,
● does not cause a repaint.
55
94. Compositing borders
● Blue: page tiles.
● Green: has a compositing layer with its own painted content.
● Orange: has a backing store and extend partially offscreen, so it’s converted to tiled
layers.
● Pale Blue: clipped layer.
● Light Blue and Dark Blue: the image is being mapped directly into the backing store
without having to be painted.
● Yellow: container layers have blue borders with a yellow inner border.
● Bright Pink: elements with backdrop filters.
94
95. Compositing borders
● Blue: page tiles.
● Green: has a compositing layer with its own painted content.
● Orange: has a backing store and extend partially offscreen, so it’s converted to tiled
layers.
● Pale Blue: clipped layer.
● Light Blue and Dark Blue: the image is being mapped directly into the backing store
without having to be painted.
● Yellow: container layers have blue borders with a yellow inner border.
● Bright Pink: elements with backdrop filters.
95
100. Reported issues
● Webkit bugzilla - Status: NEW, ~ 22 similar issues
● Apple bugzilla - Status: NEW. Reproduced on Apple
website.
100
101. Lessons learnt
● Be ready to support new devices
● Be careful with compositing layers especially on iOS devices
● Pay attention to your assets
● Use iframes only in case of necessity
● Perform regression testing when new OS is installed
101