OZONE Asylum
Forums
DHTML/Javascript
JS animation performance: reflow/redraw cost, CPU use?
This page's ID:
30631
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
John Resig has also written [url=http://ejohn.org/blog/how-javascript-timers-work/]about JS timers[/url] (how they work), and [url="http://ejohn.org/blog/analyzing-timer-performance/"]performance[/url]. The latter has some interesting graphs showing timing data between browsers. It looks like Safari nails timings quite wonderfully. These tests are nearly a year old, so things may be fairly different in nightly builds of Opera, Firefox etc. I've gone back and forth between setTimeout vs. setInterval over the years for JS animation loops, and generally I've found that setInterval(animateStuff,20) tends to provide pretty good overall performance. The demos po1 linked use setTimeout() with 0 or 1, but I presume that is done to encourage the highest execution speed possible rather than a value that provides a fast, but not necessarily CPU-pegging framerate. [small](Edited by [url=http://www.ozoneasylum.com/user/2276]Scott[/url] on 11-07-2008 23:56)[/small]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »