Throttle rAF/animations for obscured frames |
|||||||
Issue descriptionChrome 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.
,
May 31 2017
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?)
,
May 31 2017
,
May 31 2017
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.
,
Jun 2 2017
,
Jun 2 2017
,
May 8 2018
|
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by chrishtr@chromium.org
, May 29 2017