In most projects there are tons of events that are dispatched, but that have no listeners subscribed to them. This shouldn't be an issue, but it turns out that the Flash Player deals with these events inefficiently. Luckily it's pretty easy to patch this for specific situations.

The code below will run about 5X faster than a standard dispatchEvent call when there is no event listener for the event type.

override public function dispatchEvent(evt:Event):Boolean {
 	if (hasEventListener(evt.type) || evt.bubbles) {
  		return super.dispatchEvent(evt);
  	}
 	return true;
}

Note that the actual time difference is fairly minimal (80ms vs 450ms for 100,000 iterations in my tests), so I would only do this in classes that you are going to create a lot of instances of and which will generate a lot of events that may not have listeners.

For example, I used this in GTween, because you could have thousands of tweens active at the same time, each of them dispatch CHANGE events every frame while active, and it's very common to create tweens without a listener for that event.

While I think this will work for all cases, I haven't tested extensively with less common event scenarios. Bubbling events should work, but you won't get a performance increase.

This change also reduces efficiency for events that do have listeners, but it is very minimal (<10%, 505ms vs 545ms for 100k iterations in my tests).