# How dispatchEvent() effects Performance?

**URL:** <https://forum.kirupa.com/t/how-dispatchevent-effects-performance/326297>\
**Category:** flash\
**Created:** [December 5, 2011, 6:44pm UTC](https://forum.kirupa.com/t/how-dispatchevent-effects-performance/326297 "2011-12-05T18:44:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thovas](https://avatars.discourse-cdn.com/v4/letter/t/ba9def/32.png) [@Thovas](https://forum.kirupa.com/u/Thovas)\
**Post date:** [December 5, 2011, 6:44pm UTC](https://forum.kirupa.com/t/how-dispatchevent-effects-performance/326297/1 "2011-12-05T18:44:57Z")

</div>

My question is more like “How dispatching custom event effects performance, if there is no listeners for these events?”

For example i have the following function:

```php
public function checkSomething():void{
if(someBolean){
    doSpecificSomething1();
    dispatchEvent(new CustomEvent(target, CustomEvent.GENERAL_EVENT);
    dispatchEvent(new CustomEvent(target, CustomEvent.SPECIFIC_EVENT_1);
  }
if(someOtherBolean){
    doSpecificSomething2()
    dispatchEvent(new CustomEvent(target, CustomEvent.GENERAL_EVENT);
    dispatchEvent(new CustomEvent(target, CustomEvent.SPECIFIC_EVENT_2);
  }
}

```

So my question is how dispatching this events will effect performance, and should i refrain from dispatching more then 1 event. The question is relevant for both cases of the dispatched event been listened to or not.

Thanks in advance  
Regards Thovas
