View Layer Performance
- Screaming Crowd
- Views all the way down
- Stay in the Run Loop
- Forcing Reflows
Screaming Crowd
By default, Ember listens to a large number of events
Remove touchmove
, mousemove
, mouseenter
, and mouseleave
events from Ember.EventDispatcher.events
Views all the way down
{{value}}
, {{#if prop}}
, and {{myHelper prop}}
all create Views
{{unbound}}
and {{#group}}
can prevent this
→ cut our render time in half
Avoid excessive View
creation - do you need to bind?
Stay in the Run Loop
What happens if you run code outside an Ember run loop?
Bindings, promises, and more schedule a run loop via setTimeout(fn, 0)
...
setTimeout(fn, 0)
fn()
...
...
setTimeout(fn, 0)
paint, reflow
fn()
...
Wrap all out-of-Ember event handling in Ember.run