emberjs/ember.js — pull request #2810 by robharper (2013-06-07 19:59:11+00:00)
Title: Allow base set of events to listen on to be customized in EventDispatcher (for performance)

Moves the hash of events -> handler names from a hash defined within the `setup` function of EventDispatcher to an overridable property on the class.

The motivation for this PR is to be able to turn off dispatcher handling of unused events, specifically `mousemove`/`touchmove`/`drag` due to high heap thrashing.

Below are two screenshots of memory heap usage of an application taken while holding down the mouse button and dragging the cursor back and forth over the app.

*With all default events registered:*
![screen shot 2013-06-07 at 3 14 20 pm](https://f.cloud.github.com/assets/900789/625669/530e57be-cfa7-11e2-94a7-d4cafbebd6ce.png)
Observe how 8MB of memory is used and then gc'd every ~4 seconds (2 MB/s)

*With mousemove/touchmove/drag and other high rate events commented out:*
![screen shot 2013-06-07 at 3 11 27 pm](https://f.cloud.github.com/assets/900789/625675/65f3b356-cfa7-11e2-8b92-6f14d10c2560.png)
Observe how 6MB of memory is used and gc'd over ~8 seconds (.75 MB/s).

Note that in both cases no views are actually registered for any of the events - this is just the cost of the event listeners + delegation to nowhere.

This PR would allow performance sensitive apps stop Ember from registering costly listeners on unused events.