XML Feeds

.

[javascript-dev] Re: Re: Re: Re: jsui was a mistake.

mzed mzed at cnmat.berkeley.edu
Fri Oct 5 15:23:47 MDT 2007


Another way to reduce jsui's overhead is to have it draw less often.  This code is excerpted from CNMAT's resonance-display.js:

function ndraw()
{
if (needtodraw==1)
{
draw(); needtodraw = 0
}
}
var tsk = new Task(ndraw);
tsk.interval=100;
tsk.repeat();

and there's a "needtodraw = 1" statement in the bang method. Look at the whole js for context.

There's no point in drawing faster that the screen refresh rate, no matter how much data is coming in.  Our function sets the rate at 10 fps, which is totally fine.

mz

PS Still in favor of a lui *in addition to* jsui.  The more the merrier, sez I.

--
|| michael f. zbyszynski -- molecular gastronimist
|| http://www.cnmat.berkeley.edu/
|| http://www.mikezed.com/





More information about the javascript-dev mailing list