Closed Bug 1372106 Opened 7 years ago Closed 6 years ago

Enable compositor ASAP mode caused high CPU usage

Categories

(Core :: Graphics: WebRender, enhancement, P3)

enhancement

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox56 --- unaffected
firefox57 --- unaffected

People

(Reporter: pchang, Unassigned)

References

Details

(Whiteboard: gfx-noted)

While I was running talos testing, I found high cpu usage when talos ASAP mode was enabled by the following two configurations.

'layout.frame_rate': 0,
'docshell.event_starvation_delay_hint': 1,

With these configuration, compositor will render as fast as it can. If I switched the tab or reload the tab content, the OMTA was running and I hit the high CPU usage. Gecko without WebRender works fine with ASAP mode.

After checking, the high CPU usage was caused by too many GenerateFrame calls with animations in [1].


[1]http://searchfox.org/mozilla-central/source/gfx/layers/wr/WebRenderBridgeParent.cpp#872
(In reply to Peter Chang[:pchang] from comment #0)
> With these configuration, compositor will render as fast as it can. If I
> switched the tab or reload the tab content, the OMTA was running and I hit
> the high CPU usage. Gecko without WebRender works fine with ASAP mode.
> 
> After checking, the high CPU usage was caused by too many GenerateFrame
> calls with animations in [1].
> 
I guess we off lost of loading from compositor to renderer thread and we don't block compositor after dispatching composition to WebRender. So compositor thread was very lightweight and kept dispatching works to WebRender under ASAP mode.

It also helps if I replace GenerateFrame with animations with GenerateFrame().

> [1]http://searchfox.org/mozilla-central/source/gfx/layers/wr/
> WebRenderBridgeParent.cpp#872
Does the fix from bug 1365196 not prevent this?
Has STR: --- → yes
Priority: -- → P3
Whiteboard: gfx-noted
Bug 1461239 and other bug fixes reduced cpu usage.
I did not see the high cpu usage with WebRender than non-WebRender.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.