Closed Bug 1688086 Opened 3 years ago Closed 3 years ago

Unnecessary CPU usage on the main thread from compositor vsync notifications

Categories

(Core :: Graphics, defect)

defect

Tracking

()

RESOLVED FIXED
86 Branch
Tracking Status
firefox-esr78 --- wontfix
firefox84 --- wontfix
firefox85 --- wontfix
firefox86 --- fixed

People

(Reporter: mstange, Assigned: tnikkel)

References

(Blocks 2 open bugs, Regression)

Details

(Keywords: power, regression)

Attachments

(1 file)

Profile

When the compositor is registered for vsync, the vsync distribution mechanism doesn't only notify the compositor, it also dispatches a runnable to the parent process main thread to call NotifyGenericObservers. This wakes up the event loop on the main thread and causes unnecessary CPU usage.

https://searchfox.org/mozilla-central/rev/8dae1cc76a6b45e05198bc0d5d4edb7bf1003265/gfx/thebes/VsyncSource.cpp#121-123

We should make sure that this runnable only gets dispatched if there are observers to notify.

Regressed by: 1630912
Has Regression Range: --- → yes
Assignee: nobody → tnikkel
Status: NEW → ASSIGNED
Pushed by tnikkel@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bdf3ea4f60ba
Only dispatch a runnable to the main thread to notify it of vsync if there are main thread observers for it. r=mstange
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: