rmsmith/ace.dart — pull request #45 by rmsmith (2014-05-22 11:24:30+00:00)
Title: Lazy events

This change is a significant performance optimization both in terms of code size and execution speed. As a data point, this reduces the compiled size of my application by 20 kb (unminified) / 8 kb (minified). We don't have measurements in place for execution speed but it should also have sizeable gain there.

Prior, we were registering event callbacks for every event stream on every proxy object with the underlying javascript object, even if no listener was ever attached to the dart stream. This was incurring a lot of copying of data over the dart:js boundary and adding of data events to streams with no listeners. It was also pulling in the transitive code of the event arguments, so for example you'd have the `LinkEvent` class in your compiled code, even if you never listened on any link event streams.

FYI @devoncarew @umop I have bumped the version to `0.4.0` with this change as it is fairly significant and there may be subtle behavior changes (hopefully only for the better!) Please let me know if you run into any problems once you update.