# Overhead of "unlistened" Events?

**URL:** <https://forum.kirupa.com/t/overhead-of-unlistened-events/301930>\
**Category:** flash\
**Created:** [December 17, 2009, 11:02pm UTC](https://forum.kirupa.com/t/overhead-of-unlistened-events/301930 "2009-12-17T23:02:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![IQAndreas](https://avatars.discourse-cdn.com/v4/letter/i/f08c70/32.png) [@IQAndreas](https://forum.kirupa.com/u/IQAndreas)\
**Post date:** [December 17, 2009, 11:02pm UTC](https://forum.kirupa.com/t/overhead-of-unlistened-events/301930/1 "2009-12-17T23:02:11Z")

</div>

I’m wanting to override most properties (at least the display ones such as x, y, z, scale, alpha etc) of a class. Whenever one of those values changes, they will dispatch a custom event.

Especially with hundreds of items at once, this is likely to affect performance, especially on items that are constantly moving.

**Will Events that are never listened to affect the performance anything?** Is it mainly all the different listener functions that are what slow down?

Would this make any difference performance wise? (Mainly referring to the “hasEventListener” check)

```auto
public override function set x(new_x:Number)
{
   if (this.hasEventListener(ChangeEvent.X))
   {
      //Check if the event was canceled
      if (this.dispatchEvent(new ChangeEvent(ChangeEvent.X, new_x, _x)))
      {
         _x = new_x;
      }
      else 
      {
         //Cancelled. Do nothing.
      }
   }
   else
   {
      _x = new_x;
   }
}

```

I’m guessing at least there might be a slight improvement, since it doesn’t need to construct a new “Event” unless neede
