New issue
Advanced search Search tips

Issue 727399 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature


Show other hotlists

Hotlists containing this issue:
Interventions
TaskThrottling


Sign in to add a comment

Throttle rAF/animations for obscured frames

Project Member Reported by flackr@chromium.org, May 29 2017

Issue description

Chrome Version: 61.0.3114.0
OS: Android 5.1.1

What steps will reproduce the problem?
(1) Open http://www.healthline.com/health/cold-flu/sinus-infection-symptoms?m=0#Congestion5 on a slow phone (I used a Nexus 4)
(2) Record a performance timeline.
(3) Tap the hamburger menu button at the top-left corner.

What is the expected result?
We should fire the animation frame function once and generate one frame.

What happens instead?
According to the timeline, the GPU and raster thread were not busy at all.

It looks like a requestAnimationFrame function is fired 6 times throughout the 679ms frame for me. Shouldn't we only fire this at most once per main frame?

Also we seem to update the layer tree and paint 9 times throughout the frame but only actually produce 1 frame (according to the Frames timeline). These didn't seem to be script triggered (there was only one forced style and layout during the click handler).

Please use labels and text to provide additional information.


For graphics-related bugs, please copy/paste the contents of the about:gpu
page at the end of this report.

 
Profile-20170529T170316.json
5.3 MB View Download
Components: -Blink>Paint Blink>Scheduling
Components: Blink>Animation
Status: Available (was: Untriaged)
Looks like what's going on is that there's a constantly animating ad on the page which gets covered by the hamburger menu. However we fail to realize that the ad is fully obscured and keep ticking CSS animations for it at 60 fps. Each animation frame runs and decides there's nothing to render (EarlyOut_NoUpdates), which is why you only see only one actual frame being produced when the menu opens but several rAFs which don't lead to screen updates.

I think everything is working correctly here, but for efficiency we should start throttling frames that are fully covered by other elements. (Could we extend IntersectionObserver to do this?)
trace_raf.json.gz
3.2 MB Download
Cc: ojan@chromium.org delph...@chromium.org
Summary: Throttle rAF/animations for obscured frames (was: Animation Frame Fired six times and updated layer tree and painted nine times in one main frame.)

Comment 4 by ojan@chromium.org, May 31 2017

Cc: szager@chromium.org
IntersectionObserver v2 is planned (although unstaffed at the moment) to deal with occlusion detection. It's not clear how it will pan out since occlusion detecting is much more expensive. So, we'll have to evaluate once we have a prototype if it's performant enough to occlusion detect every iframe in the page that intersects with the viewport (for one's that don't intersect, we can skip the occlusion detection).

My intuition is that it'll work well, but we don't know till we build it. This might be a good starting point for prototyping IOv2 since it's an internal use case that we can iterate on and explore how it works on real content.

A more general intervention I've wondered is if we should throttle rAF for sites that are constantly ticking rAF but not painting anything new.
Labels: -Type-Bug Type-Feature
Labels: Update-Quarterly

Comment 7 by ojan@chromium.org, May 8 2018

Cc: -ojan@chromium.org

Sign in to add a comment