Closed Bug 729656 Opened 14 years ago Closed 13 years ago

Animated Personas cause unexpectedly high CPU usage

Categories

(Toolkit :: Themes, defect)

x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: sdrocking, Unassigned)

References

()

Details

(Whiteboard: [Snappy:P2] [telemetry-needed])

Attachments

(1 file)

After installing this persona Firefox constantly uses 40-45% of the CPU. https://addons.mozilla.org/en-US/firefox/addon/metal-flowers-animated/
WFM on Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:13.0) Gecko/20120222 Firefox/13.0a1 ID:20120222031223 ~20% CPU usage with this persona on 2 windows (4 app tabs and 5 tabs).
What is your CPU usage normally? For me normally CPU remains under 10% but with this persona it starts fluctuating around 40-45%.
Confirm. On my Quad Core CPU 6-14%.
Confirmed on Single Core - Pentium 4... Without any animated personas CPU usage fluctuates between 10-35% on average With any animated personas CPU usage fluctuates between 35-80% on average, but on occasion it hits 100% CPU usage.
I confirm the CPU usage after installing the animated persona you linked. See my capture with FF10 and FF13: default theme -> animated persona -> default theme
Sorry, I forgot my config: Intel Core i5-2410M 2.30GHz
(In reply to alex_mayorga from comment #1) > WFM on Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:13.0) Gecko/20120222 > Firefox/13.0a1 ID:20120222031223 > > ~20% CPU usage with this persona on 2 windows (4 app tabs and 5 tabs). I'll take that back, normally Nightly uses 2% CPU so this is a 10 fold increase. Intel Core i5-2540M 2.60GHz Confirming.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Thanks for finally confirming this. This is a featured persona with ~25K ADUs. I wonder why no one reported this before. And there are users who would've blamed Firefox instead.
Component: Extension Compatibility → Themes
Product: Firefox → Toolkit
QA Contact: extension.compatibility → themes
Whiteboard: [Snappy] → [Snappy] [telemetry-needed]
Animated personas are a terrible idea. Going to block this on fixing non-animated personas(and whatever redesign that requires) before we proceed here.
Depends on: 650968
Whiteboard: [Snappy] [telemetry-needed] → [Snappy:P2] [telemetry-needed]
It's already possible to stop animations (eg, press ESC in a page with an animated gif), I'd suspect it should be fairly simple to have chrome just immediately do that whenever applying a persona? There's probably still some memory overhead for the animation frames, not sure how smart we are with that (afaik we still do work with gifs to avoid giant decoded buffers hanging around, not sure of APNG gets similar treatment). Halting animations should be a trivial fix, but I do wonder how much of this is a problem with with images/gfx/invalidation/whatever. There was an old Firefox 4 (3?) bug about the 16x16 APNG throbber eating significant CPU when shown. Given the popularity of sites like http://www.gifbin.com/ and http://gif.tv, I'd worry a bit that animated personas are just 1 instance of a much more general problem.
(In reply to Justin Dolske [:Dolske] from comment #10) > There's probably still some memory overhead for the animation frames, not > sure how smart we are with that (afaik we still do work with gifs to avoid > giant decoded buffers hanging around, not sure of APNG gets similar > treatment). To be clear, we just store the GIF data raw for subsequent frames; we convert it to RGBA for the first frame only. APNG has no such internal optimization, and as such it has no similar treatment.
Oh dear. So, that implies that with 3000x200 Persona headers, each frame is 2.4MB of RGBA data (or a mere 1.8MB if it can end up as just RGB). 1.5x those numbers if the Persona has a similarly-animated 3000x100 footer too. Yeahhhhhh... We should kill that. I'm guessing we never discard decoded frames even when the animation is stopped, so we should probably just detect animations and refuse to load them. Probably need a spinoff big to detect and kill these on the server too (to block new uploads, and clear out Personas that would actually no longer work).
Assignee: nobody → paul
(In reply to Justin Dolske [:Dolske] from comment #12) > (or a mere 1.8MB if it can end up as just RGB). It can't. > I'm guessing we never discard decoded frames even when the animation is > stopped We never discard animated images, full stop.
Only the first frame is full-size. Frames that animate butterflies are much smaller and do not require a lot of memory. It's almost always the case. Hard 300k size limit forces Personas Authors to animate only a small portion of the image.
Assignee: paul → nobody
(In reply to Justin Dolske [:Dolske] from comment #12) > Yeahhhhhh... We should kill that. That's been done by bug 650968. It would display animated LWTs right after the installation but those would be cropped versions of the first frames after a restart. > I'm guessing we never discard decoded frames even when the animation is > stopped, so we should probably just detect animations and refuse to load > them. Probably need a spinoff big to detect and kill these on the server too > (to block new uploads, and clear out Personas that would actually no longer > work). We still need to do this. We could alternatively take the first frame of existing animated LWTs and convert them to non-animated automatically.
Maybe you should announce somewhere that animated personas are about to be killed. And ask users for feedback.
Fixed by bug 650968.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: