Skip to content Skip to sidebar Skip to footer

Estimate Browser Js Engine Speed To Conditionally Disable Animations

Is there a standard (accepted/easy/performant) way to determine how fast a client machine renders javascript? When I'm running web apps (videos, etc) on my other tabs my JS animati

Solution 1:

One tip is to disable those hidden animations. if they are on another tab that is not in focus, what's the use of keeping them animated?

Another is to keep animations to a minimum. I assume you are on the DOM, and DOM operations are expensive. keep them to a minimum as well.

One tip I got somewhere is if you are using image animation manipulation, consider using canvas instead so that you are not operating on the DOM.

Also, consider progressive enhancement. Keep your features simple and work your way up to complicated things. Use the simple features as a baseline every time you add something new. That way, you can easily determine what causes the problem and fix it accordingly.


The main problem you should first address is why it is slow, not when it is slow.

Solution 2:

I know this question is old, but I've just stumbled across it. The simplest way is to execute a long loop and measure the start and end time. This should give you some idea of the machine's Javascript performance.

Please bear in mind, this may delay page loading, so you may want to store the result in a cookie, so it's not measured on every visit to the page.

Something like:

var starttime = newDate();
for( var i=0; i<1000000; i++ ) ;
var dt = newDate() - starttime;

Hope this helps.

Post a Comment for "Estimate Browser Js Engine Speed To Conditionally Disable Animations"