Skip to content

Instantly share code, notes, and snippets.

@kratiahuja
Created July 7, 2015 23:36
Show Gist options
  • Save kratiahuja/9ebf252d1526fcd9fad8 to your computer and use it in GitHub Desktop.
Save kratiahuja/9ebf252d1526fcd9fad8 to your computer and use it in GitHub Desktop.
This file describes the various performance hooks we need during an ember application boot up phase

#Ember boot up hooks This document describes the high level use cases and various user hooks that are needed during the ember boot up phase.

Use cases

We want to measure the time an ember application takes to boot up before it can serve any requests. There are various stages in the boot up phase (creating the application instance, running the initializers etc). We want to capture the time it took during the boot up to recongize any potential performance issues. For this, we need public hooks to add timing measure ments. Following are the time measurement use cases that we would like to capture:

  • Amount of time the application took to boot: The boot phase starts after jquery 'ready' event is fired. We need a hook that indicates this event is fired.
  • Amount of time the application is in 'deferred' state: Ember allows to delay the boot phase and perform any operations before boot by putting the app in defered state. We need general hooks to indicate the start and end of the defered state
  • Amount of time to setup the router after boot up and serve the initial URL

Hooks needed

  • Hook to indicate start of the boot up phase
  • Hook to indicate the end of boot up phase in fastboot mode (currently the 'ready()' event is only fired when the app boots in the browser)
  • A general hook to indicate the start and end of deferred state during boot up
  • Hook to indicate the the start and end of routing (after booting the app) phase that sets up the router and handles the URL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment