Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the CPU usage so high in Firefox when using CSS3 animation property? [closed]

Tags:

html

css

Today I was going to make a couple of keyframe animations using CSS. I'm using the following CSS:

-webkit-animation: ballanim 5.6s infinite;
     -o-animation: ballanim 5.6s infinite;
        animation: ballanim 5.6s infinite;

There is a big problem though, and I don't know if it's a problem with my code or if it is a Firefox problem. For comparison, on 10X of these animations:

  • Safari: 12.8% CPU usage.
  • Firefox: over 70% CPU usage.

I uploaded my webpage here:

http://hkwh01.99k.org/test/services.html

Is Firefox not suitable for CSS animations? Does anybody know the reason for this? Should I think of another method to do animations?

like image 960
FatDogMark Avatar asked Dec 08 '12 15:12

FatDogMark


People also ask

Why is Firefox CPU usage so high?

Disable resource consuming extensions and themes Extensions and themes can cause Firefox to use more system resources than it normally would. To determine if an extension or theme is causing Firefox to use too many resources, start Firefox in Troubleshoot Mode and observe its memory and CPU usage.

How do I reduce Firefox CPU usage?

Some of the major ways to Fix High CPU Usage with the Firefox browser are to restart the browser, restart the PC, update the Browser, refresh Firefox, Decrease Content Process Limit, Delete content-prefs. sqlite file, Enable Hardware Acceleration, Use Strict Tracking Protection and Boot Firefox to Safe Mode.


1 Answers

CSS animations are supposed to be hardware (GPU) accelerated.

Look at this really evil example http://ie.microsoft.com/testdrive/Performance/Chalkboard/ and compare performance of IE10 (native HWA by default) and other browsers (no HWA by default, currently). Then - enable HWA, and see how much better other browsers perform second time (but still worse than IE10).

Until the time, when all your target browsers will support HWA by default, you should not rely on animations for non-essential features. And its probably a good idea to disable animations for them.

like image 65
c69 Avatar answered Sep 20 '22 22:09

c69