hello,
I am trying to correct a few performance issues with my application,
which display live market data in JTables.
for each update, I use the "invokeLater" method, so create a new
Runnable, and append one event to the event-dispatching thread.
at some point, I can see in my profiler that the dispatching of event
is getting bloated and slow, most probably because of a big number of
almost simultaneous updates.
my idea would be to query the size (length) of the event-dispatching
thread, and in case it's already big (value to determine), I could
decide on advertising only part of the updates (some are more important
than others).
would you know of a method or way to achieve that ?
thanks for your help
Antoine
Andrew McDonagh - 18 Jan 2005 23:28 GMT
> hello,
>
[quoted text clipped - 17 lines]
>
> Antoine
Pretty sure there isn't a mechanism to do this, but have you thought
about inverting the responsibility of updating the GUI?
In other words, instead of creating loads of runnable objects with a new
value to be used by the gui, you could create just a few Runnable
objects every second, but instead of them containing the value to use in
the GUI, they poll your application for the latest value. This way you
won't be saturating the EventDispatch thread.