Re: SVG speed?

HelderMagalhaes <[email protected]>
Newsgroups gmane.comp.mozilla.devel.svg
Organization http://groups.google.com
Message-ID <6a486be0-4a56-4bd8-871b-a7884642e874@o40g2000prn.googlegroups.com>
> > Using "setInterval" is not recommended due to a Firefox issue [2].
>
> Err.. I think you are reading way too much into that bug. Do you have
> any data to back up that it's causing enough problem that setInterval
> and/or setTimeout should be stayed away from?

I don't think that they should be stayed away from. John Resig even
made a great overall look on the current status of browser timing [1]
and Firefox was one of the most accurate. Nevertheless, trying to
clear up a bit on my previous post, my understanding of this is that:

 1. setInterval will conceptually not take into account the time took
to run the code in each call (please correct me if I'm wrong!) so, if
the benchmark code is too long and/or the timing too short, this can
cause really messed up results...

 2. Running one of the test cases in the referenced bug [2] sometimes
still shows inaccurate timing. Sample using Firefox 3.0.4:
    [...]
    f1: 1404ms-> Greater than 10% error!
    f2: 1403ms-> Greater than 10% error!
    f1: 593ms-> Greater than 10% error!
    f2: 593ms-> Greater than 10% error!
    [...]
    Intuitively, this specific result set makes some sense as we would
expect the average timing to correspond to the desired target trigger
time. But using this for accurate timing measurements can be naturally
misleading, reason why setTimeout is advised instead. Another sample
using Firefox 3.2a1:
    [...]
    f1: 2230ms-> Greater than 10% error!
    f2: 2230ms-> Greater than 10% error!
    [...]
    This specific one doesn't make much sense as the samples before/
after are all within very close to 1 second, so here setInterval won't
even correspond to the desired "average" behavior above. I've also
noticed that using a high load machine makes the issue much easier to
reproduce, which makes sense. Nevertheless, these two samples were
obtained it the first run using a machine with almost (< 5%) no load.
Operating system used was Windows XP SP3 in a Pentium IV with 1GB RAM.
Would it be valuable to update the bug report with more information
such as this one and potentially more? If so, which details would also
be relevant regarding this?

Best regards,

 Helder Magalhães

[1] http://ejohn.org/blog/accuracy-of-javascript-time/
[2] https://bugzilla.mozilla.org/attachment.cgi?id=263884
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.