Talk about general profiling & performance for Hybrid Applications, as well as some Ember specific tips. For Cordova + PhoneGap.
Presented on Jan 29 2016 at PhoneGap Day in Salt Lake City.
1. Hybrid Apps with Ember:
Lessons Learned
@alexblom
alex@isleofcode.com
2. Who am I
• Programmer;
• Started with Java/C;
• Mostly Ruby/Rails;
• Go;
• Ember for ~2.5 years;
3. Isle of Code
• Toronto + Chicago based development;
• Focused on:
• Prototyping;
• Single sourcing mobile /w Ember.js & Cordova;
and
• A lot of beacon work.
12. Good Code == Good Hybrid
• Much of making effective mobile is simply writing
good code;
• Desktops let us be lazier;
• JS ecosystem is littered with bad/leaky code;
26. What causes Reflow?
• Resizing the browser window;
• using JavaScript methods involving computed
styles;
• adding or removing elements from the DOM; and
• changing an element's classes.
• https://developers.google.com/speed/articles/reflo
w
38. Run Loops
• Ember.run.schedule(‘afterRender'
• Other tools for scheduling asyncronous
callbacks;
• Solves many problems - but not all of them. We
still can’t be animating while transitioning;
40. • Route animations can be choppy, as the UI
thread is shared with items such as model hooks
and expensive computations;
• In native, it is easy enough to have 1 thread for
the transition/animation (UI thread) and
another for more complex work;
41. • More work around WebWorkers for handling
background requests and pushing to the Ember
store;
52. Canvas
• Choppy and deal breaking. This is common when
working with DOM;
• Need to move to Canvas;
• ~16ms target for animations, DOM can’t do this;