ericdrowell/KineticJS — pull request #328 by thulka (2013-03-19 16:19:21+00:00)
Title: Some lines that speed up event handling (20 to 18 % time spent) and make code cleaner.

The event handler function was fetched upon every fired event. This is
now avoided by fetching the function once before adding the listener.
This is partly a refactoring but also changes the code, since changes of
the events in that[] are now considered only during the call of
_bindContentEvents. If an event is removed between event firings however, the previous code
would crash anyway, since

that['_' + event]

would then be null. So I believe it is save not to evaluate that[] upon every fired event.

Performance profiling showed slight advantage, from 20% spent to 18% spent inside
event handler. And the code is cleaner.