New issue
Advanced search Search tips

Issue 883031 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug
M-X



Sign in to add a comment

Same-sized windows not considered occluded

Project Member Reported by sdy@chromium.org, Sep 11

Issue description

Chrome Version: 71.0.3549.0
OS: macOS

What steps will reproduce the problem?
(1) Open a window to a page that burns CPU (ongoing animation or a media player is ideal). Make the window the full size of the screen.
(2) Open a second window, which should be created at the same size as the first one, to about:blank.
(3) Look at the Task Manager.
(4) Make the "heavy" window smaller than the blank window and repeat the test in (3) (move the blank window in front, then check the task manager)

What is the expected result?
The CPU usage of the background page drops dramatically while it's in the background.

What happens instead?
While the background page is the same size as the foreground page, its CPU usage does not drop. When it's slightly smaller, it does drop.

I couldn't test this on Windows because the background tab always used full CPU. Maybe there's no occlusion tracking on Windows?
 
overcautious_occlusion.mp4
7.6 MB View Download
Cc: ellyjo...@chromium.org
+ellyjones@ for triage.
Cc: -ellyjo...@chromium.org
Owner: ellyjo...@chromium.org
Labels: Proj-DesktopUI
Labels: Group-Performance
Labels: Hotlist-DesktopUITriaged
Status: Assigned (was: Untriaged)
Labels: -Pri-2 Target-72 M-72 Pri-3
Easy repro case:

1) Open window 1 to the attached HTML page.
2) Open window 2 to about:blank or similar.

Check task manager - both windows should be using ~0 CPU.

3) Click the "Busy" button in window 1.

Check task manager - the "busy" page should be using around 6-7% CPU as it wakes up at 100Hz.

4) Make both windows the exact same size - the easiest way to do this is to just drag them to the maximum allowed size.
5) Vary which window is in front

Check task manager - the "busy" page will use 6-7% CPU consistently.

6) Drag the "busy" window to be a bit smaller, and switch to the blank window

Check task manager - the "busy" page will be at 0% CPU.
Labels: -Pri-3 Pri-2
Huh. We don't receive occlusion change notices at all in this situation - NSWindowDidChangeOcclusionStateNotification appears not to be delivered. I think the occlusion notifications are only delivered when parts of the window are shown/hidden, but the logic in WebContentsViewMac needs to also listen for the Widget's activation state to change. Otherwise, no notifications arrive about occlusion state at all.

For example, try this:

1) Open window 1 to busy.html
2) Open window 2 to about:blank
3) Move both windows into the top right corner
4) Start the busy loop in window 1
5) Make window 2 larger than window 1
6) Vary which window is active

In all cases, the busy loop keeps running at 6% CPU or so, so something is pretty broken here.
busy.html
192 bytes View Download
Labels: -Pri-2 -M-72 -Target-72 M-X Pri-3
Owner: ----
Status: Available (was: Assigned)
Actually, #9 is wrong - everything works fine so long as the windows do not share an edge. I don't really know why this is but it doesn't seem urgent to me, so I'm kicking it out of M72 and my queue.
Labels: Hotlist-DesktopUIChecked Hotlist-DesktopUIValid
***Mass UI Triage*** As per comment #11

Sign in to add a comment