Miguel wrote:

PROBLEM: After some number of events, the counter runs -- the textarea
updates
-- but the animation gets ragged and finally fails altogether.

SOLUTION: Clear the textarea.

COMMENT: The applet is running just fine. What is complicating the issue
is that
the callbacks are being monitored in a textarea. This list gets pretty
long, and
at some point the updating of the textarea is slow enough that it messes
up the
frame updates.



This is one of the problems/evils with the callbacks.

Accumulating lots of text in a textarea for display to the user can cause
major performance problems. On many platforms JavaScript simply cannot
handle it.



This is not a Jmol problem, as I recognized in an earlier dialog with Miguel "slow script execution is no Jmol problem" in May 04 you simply had to implement the text area as a fifo stack. By determining the size of the stack (array) you restrict the JavaScript slow down to the necessary minimum.
The problem was less information through the callback function. e.g. in an earlier version of Jmol v10, the echo command was returned together with the "echo" in the callback (which was a bug but a feature), I could simply increase the fifo stack size by each /^echo\s/ in the callback, to ensure that the whole RasMolScript messages are displayed on the textarea.
I would argue, that the callback has to be extended by a separate field for the interpreted (some thing like the Java console output may be ok) command to make the stack size regulation more easy. (file output commands should report file size information e.g. like wc in this interpreted command field
show file "samples/pdb/toluene.pdb"
could result in e.g.
show file "samples/pdb/toluene.pdb" # 34 218 1475
using the interpreted command canal of the callback function, thus enabling us to increase JavaScript fifo to a size of at least 34 lines
)
The alternative I used now, was to echo fifo stack size regulating commands which I inserted into the RasMol scripts before any textarea consuming commands.
Regards, Jan


Miguel






-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
Jmol-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to