Skip to content

Instantly share code, notes, and snippets.

@tennisonchan
Last active September 28, 2016 13:35
Show Gist options
  • Save tennisonchan/ca6a1d842662c2ab6354bf565626a4f9 to your computer and use it in GitHub Desktop.
Save tennisonchan/ca6a1d842662c2ab6354bf565626a4f9 to your computer and use it in GitHub Desktop.
An Ember render performance initializer to log all the render performance metrics
import Ember from 'ember';
export default {
name: 'ember-render-performance',
initialize() {
Ember.subscribe('render', {
before(_, startTime) { return startTime; },
after(name, endTime, payload, startTime) {
console.log(`${payload.containerKey || name}`, endTime - startTime);
}
});
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment