How taxing are listeners on game performance?

I’ve recently started fresh with code for my program to give it more structure/organization and make debugging easier. I now have a hierarchy of modules and, for the most part, functions are only required in one direction down the hierarchy.

However, as expected, there are times when a happening low in the hierarchy needs to trigger something higher up, for which I use custom event dispatching and listeners. I am trying to keep these to a minimum, but I posted this to hopefully get some insight into how taxing listeners are on performance. Is each listener (even ones that are triggered singularly on occasion as opposed to almost constantly) as burdensome as, say, an object with physics would be? How many is too many (ballpark)? Any insight on this subject would be much appreciated!

Though I can’t officially comment for certain, events are usually a core part of the kit, so while using too many will probably affect performance – like anything – I don’t think you need to be too worried from a normal, structured development perspective.

I also notice that no where in the documentation does it specify any warnings or limits to events, so that’s probably a good sign.

I’ve grown fond of event driven languages and use custom event dispatching often in my Corona coding.

Returning a true when you are certain an event doesn’t need to propagate further is a good idea as well.

See: Events and Listeners

Cheers. 

Someone, I think Roaming Gamer, made a benchmark test. He was up to the thousands of event listeners before taking a performance hit as far as I can remember. At least I decided not to worry about that after that post.

Well that’s very re-assuring. Thank you for the quick response!

I didn’t know about needing to end listeners with return true to avoid further propagation either, thank you for that tip as well.

Though I can’t officially comment for certain, events are usually a core part of the kit, so while using too many will probably affect performance – like anything – I don’t think you need to be too worried from a normal, structured development perspective.

I also notice that no where in the documentation does it specify any warnings or limits to events, so that’s probably a good sign.

I’ve grown fond of event driven languages and use custom event dispatching often in my Corona coding.

Returning a true when you are certain an event doesn’t need to propagate further is a good idea as well.

See: Events and Listeners

Cheers. 

Someone, I think Roaming Gamer, made a benchmark test. He was up to the thousands of event listeners before taking a performance hit as far as I can remember. At least I decided not to worry about that after that post.

Well that’s very re-assuring. Thank you for the quick response!

I didn’t know about needing to end listeners with return true to avoid further propagation either, thank you for that tip as well.