EmberConf Talk - disable Ember EventHandlers for mobile


#1

After seeing this great talk: http://www.confreaks.com/videos/3302-emberconf2014-animations-and-transitions-in-an-ember-app

Ed mentions right at the end that he disable site-wide EventHandlers that are used by ember to increase mobile-performance. I am quite interested in mobile optimisation myself and would like to know, how can you deactivate these global EventHandlers? Would like to play around with it myself to see how it affects performance.


#2

This should do it (CS, but easily to converted into JS):

(->
  # Improve mobile performance by removing listeners on taxing, unused events.
  # Via http://www.robharper.ca/ember-on-mobile/performance.html#/screaming-crowd
  #
  # Must be run before Ember is started (any non-library ember code is run)
  #
  # There is work to simplify this process here:
  # https://github.com/emberjs/ember.js/pull/3766

  klass = Ember.EventDispatcher
  events = klass.proto().events

  delete events.mousemove
  delete events.mouseleave
  delete events.mouseenter
  delete events.touchmove

)()

#3

That was exactly what I was looking for - thanks.