New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 671138 link

Starred by 6 users

Issue metadata

Status: Duplicate
Merged: issue 779534
Owner: ----
Closed: Nov 2
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

GIFs cause high CPU usage and low framerates

Reported by tarvorei...@gmail.com, Dec 5 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36

Steps to reproduce the problem:
1. Visit a page with at least a single GIF
2. Look at task manager
3. ???
4. High CPU usage

What is the expected behavior?
GIFs should not affect browser performance drastically.

What went wrong?
GIFs reduce the page framerates by a lot and utilize the CPU more than they should (a single, small, 50x50 pixel GIF uses about 15% CPU on a 2015 MacBook Pro with i7). A bit less on desktops running Windows, but still noticeable.

Did this work before? Yes 27 to 35

Does this work in other browsers? N/A

Chrome version: 54.0.2840.99  Channel: n/a
OS Version: 10.0
Flash Version: Shockwave Flash 23.0 r0
 
There's a million closed issues on this topic, with the verdict of being 'fixed'. Obviously, it has not been fixed. Please take this problem seriously for once.
Labels: M-55
Cc: ranjitkan@chromium.org
Labels: -M-55 -Type-Bug-Regression M-57 Performance-Memory OS-Linux OS-Mac Type-Bug
Status: Untriaged (was: Unconfirmed)
Able to reproduce the issue. Followed the below steps:

1) Navigated to Site: http://giphy.com/
2) Observe task manager for the tab "http://giphy.com/"
3) Observed that memory is increased and varies in between 700 to 900 MB within no time. Issue is observed from M33 - 33.0.1713.0. 

Issue is observed on MAC, Windows and Linux OS. 

Untriaged it so that it gets addressed.

Comment 4 by ctengc...@gmail.com, Dec 25 2016

My old notebook has also this problem.
When opening a page which contains a lot of gif images, the CPU temperature will get very high and makes a wierd noise.
Also the high CPU temperature may cause os to crash.

Can chrome provide a mechanism to throttle the gif image animations' update frequency, so that event a page contains a lot of gif images, the CPU temperature will still stay COOL?

Comment 5 by ctengc...@gmail.com, Dec 25 2016

I have a simple idea to quickly fix this: let chrome default to display only the first frame of gif image, and only animate it when mouse hovers it.

Recently web has treat `muted` <video> as animated images, and will `autoplay` it like a animated image. The reason is simple: mp4 files are encoded more efficiently than gif.

But i'm thinking why cannot treat it `BACK`: that is to say, treat gif images like video, only `play` it when it got user gestures input...
Components: Blink>Image
Components: -Blink>Image Internals>Images>Codecs
Out of curiosity I did an ETW profile of http://giphy.com/.
Here is what I found:
- Decoding seems to be only 9% of CPU cost of the renderer process. 
- Raster (cc.dll!cc::DrawingDisplayItem::Raster) is 32% with 2/3 of that (22% of the total) is exclusively in SkARGB32_Shader_Blitter::blitRect.
- Painting the tree is 36% of the total CPU cost (blink_core.dll!blink::FrameView::paintTree + blink_core.dll!blink::FrameView::prePaint).
Cc: stanisc@chromium.org
One of the reasons for slow performance may be very high number of context switches.
Here is what I see in Chrome Task Manager in "Idle Wake Ups" column:
- Browser  - 1100-1300 / sec
- GPU      - 3000-3300 / sec
- Renderer - 1600-1700 / sec

Overall -  to 6000 context switches per second.
For comparison, Edge does ~2000 context switches per second.

One of the reasons for high number of context switches in polling in GPU process - GpuCommandBufferStub::ScheduleDelayedWork which seems to be scheduling several delayed tasks per frame on this page.
Cc: -stanisc@chromium.org jbau...@chromium.org
Components: -Internals>Images>Codecs Internals>GPU>Internals
Owner: stanisc@chromium.org
Status: Assigned (was: Untriaged)
I'll take this and see if I can figure it out. 
I've removed Internals>Images>Codecs component since #8 shows that only 9% of CPU cost is in decoding. 
GpuCommandBufferStub::ScheduleDelayedWork is a more interesting suspect to pursue.
Owner: ----
Status: Available (was: Assigned)
Project Member

Comment 12 by sheriffbot@chromium.org, Nov 2

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: khushals...@chromium.org
Mergedinto: 779534
Status: Duplicate (was: Untriaged)
All of the painting costs have gone away since this bug was filed, so this should be cheaper.  Mouse-hovered gifs are not going to be web compatible, and so that's not really a direction we could go.

I think this particular bug is similar to a lot of other issues (e.g.  issue 779534 ), so I'm going to dupe it.

Sign in to add a comment