Listener traffick overhead
Hello
I find the Listener/broadcast idea to be very useful, and implement it whenever the need arises. Although I have never seen any performance issues with it, I wonder if anyone could tell me if this is ever likely to be a problem.
An example is if I am to add a huge number of data to an object using a simple method that broadcasts this event to typical listeners (typical a JTable that needs update), for each data import.
Please note that I (think I) understand how to avoid this frequent event broadcasting if needed.
Regards
Fluid
[578 byte] By [
Fluida] at [2007-11-27 9:09:36]

How much resources is used in going through a list of listeners, and broadcasting an event to these? Has anyone experienced any performance issues in regards to this (too many events in too short a time)? If so, it would be advisable for me to implement another solution to handle possible future usage of my program. If not I would not bother.
In what way is this rhetorical?
Fluida at 2007-7-12 21:49:56 >

What is going on around here? is it my language skill that is being tested, or what? Or is it customary for morons like BigDaddyLoveHandles to misuse a forum for help and discussion just to up his postcount? Who the F*** is this guy? His contribution is utter useless!
Fluida at 2007-7-12 21:49:56 >

I have been part of this forum for years, and frankly it's heading down the drains. This BigDaddy fellow; I checked out his postings, and it seems that this place is his social life. I have gotten great help here from people who are experts, and many of them are still around doing their good work. Its just frustrating running into individuals like him.
Fluida at 2007-7-12 21:49:56 >

Although I have never seen any performance issues with it
The rhetorical part referred to that.
You've never had any performance issues, but now you're doubting it (of course, just 'cos you've never had problems with something doesn't mean it'll never cause problems).
You could google for possible performance problems, that'd be a good indicator.
But, to put a long story short, no it's not a performance problem. And it never will be, unless your event mechanism is horribly written and each fired event causes something horrible to happen (say, insert 10000 rows in the database (although even then, it's not the event system's fault)).
Thank you for your answer. It is good to hear.
Rhetorical: I am asking for someone else's experience, and that cannot possibly be rhetorical unless I know the person or I believe my experience is the only experience. And you point that out: "of course, just 'cos you've never had problems with something doesn't mean it'll never cause problems".
Also I have been a member under another name previously, thus "years".
But thank you Kayaman for spending your time answering me and not wasting my time in the process :)
Much regards
Fluid
Fluida at 2007-7-12 21:49:56 >

It's pointless to try and second-guess what might be a hindrance to performance. What difference would it make, anyway? Would you avoid using events if they were going to slow your app. down?Just write Teh Codez ™ as you wish, and see if it performs ok