[Advanced-java] OT window refresh question
KCE
kurt at searchbug.com
Tue Apr 15 15:50:13 2003
On Mon, 14 Apr 2003 16:13:30 -0400
"Alvin Wang" <xwang@qtechservices.com> wrote:
>ok, here is the situation. it is a trading GUI. the
>trader wants to open 4+
>windows each of which displays the quotes of for
>different stocks and their
>options. you may know that each stock can have hundreds
>of options. this is
>real time. also, i need to subscribe various real-time
>analytical data from
>server. Whenever there are any changes, I need to update
>a cell (one option,
>including bid/ask/last, their size/exchange, theoretical
>fair value,
>greeks....), a row (all the options for a strike), a
>column (all the options
>for the an expiry) or the whole table(all the options for
>a stock). the
>trader insists to see them all and as fast as possible.
>
>i use separate threads from the event dispatch thread to
>handle the realtime
>quotes and analytical data.
>
>i believe there is no a general design guideline for all
>the applications in
>all the industries in the universe. i have to display all
>the quotes for one
>stock in one table and i cannot miss a single data(quote)
>from network, not
>becase this is a good design, because this is the biz
>requirement from the
>traders. maybe java is not a good tool to do it.
>
>Jesper and Peter, thank you very much for your answers.
>They are very
>enlightening. I really appreciate them :)
>
This is just a thought, but without seeing the source
(which, it sounds like something you're probably pretty
protective of) all I can offer is a thought or three.
1) Make sure you are just repainting the item that
changed. Repeatedly calling app.repaint() instead of
component.repaint()
is an easy mistake to make and it will kill you every
time.
2) Maybe you are not filling your message queue with too
many repaints. Try, for instance, if you are getting a
full set of 1-100 data points, only request a repaint,
say, when field 100 arrives.
3) Have a network thread fill a data structure, and have a
timer-driven thread move the data structure to the GUI,
say once every half second or so. (Don't forget to mutex
this guy!)
I realize there are many, many, other things that could be
slowing you down, but maybe one of these concepts will at
least get you thinking in the right direction.
______________________________________________________
Find People and Businesses at http://www.SearchBug.com
Innovative Messaging Solutions by GMSI, http://www.gmsi1.com