Listeners and events
I have a simple question that I can't find the answer... I just want to know the "time" overhead induced by Events and Listeners managment.
I have an experiment that makes me think it takes around 300*10^-6 sec for one "event - reception". Is that around that value ?
That would depend on how many listeners are registered for an event and how far back in the chain the specific listener you want is, as well as other factors that will be outside your control but that can greatly influence that. In any case, it is nothing more than an object calling methods from other objects. So, what is the time of about three 3 method calls and a thread activation, plus one additional method call per listener in front of the one you want. IOW, the "overhead" is not anything close to a constant but is more than fast enough that it shouldn't worry you.
What is the exact problem your facing, and what have you done to determine that this "overhead" is part of the problem?
The problem is I have a experiment on a graph with more than 16k nodes. And I do all to all routing which means 257 *10^6 routings. Each routing throw around 6 events, one for each traversed node. Without any events my simulation runs for 2 hours. With the events it takes around a day. I'm not the owner of the event-listeners implementation, so I want to know if the "problem" came from that part of the code, or if it's simply due to the java event-listener system itself
Sounds like it's a problem due to the number of nodes and not the event-listener system itself. Any system will be over-burdened by that many communications.