Results 1 to 4 of 4
  1. #1
    cglacet is offline Member
    Join Date
    Jan 2011
    Posts
    2
    Rep Power
    0

    Default Listeners and events

    Hello everyone,

    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 ?
    Last edited by cglacet; 01-20-2011 at 11:44 AM.

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    8

    Default

    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?

  3. #3
    cglacet is offline Member
    Join Date
    Jan 2011
    Posts
    2
    Rep Power
    0

    Default

    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

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

Similar Threads

  1. key listeners
    By zjames in forum New To Java
    Replies: 22
    Last Post: 11-24-2010, 05:58 AM
  2. Creating a GUI events with action listeners
    By sidd0123 in forum AWT / Swing
    Replies: 8
    Last Post: 04-02-2010, 11:32 PM
  3. Help with Listeners
    By Psyclone in forum AWT / Swing
    Replies: 8
    Last Post: 02-09-2010, 07:21 PM
  4. typed events vs untyped events.
    By Drun in forum SWT / JFace
    Replies: 0
    Last Post: 11-23-2009, 12:22 PM
  5. Seriously need help on my listeners!!
    By themburu in forum Java Applets
    Replies: 4
    Last Post: 05-26-2008, 10:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •