Consider allowing compositing to start late if scene building took too long

RESOLVED FIXED in Firefox 66

Status

()

RESOLVED FIXED
a month ago
27 days ago

People

(Reporter: mattwoodrow, Assigned: mattwoodrow)

Tracking

Trunk
mozilla66
Points:
---

Firefox Tracking Flags

(firefox66 fixed)

Details

Attachments

(3 attachments)

(Assignee)

Description

a month ago
It appears that we currently miss frames due to DL+scene-building being too slow more often than we do because of slow compositing.

https://gist.github.com/mattwoodrow/7bba3a9debb6372584e353e9ca7cc9a1

If DL+scene-building takes too long, and we miss the vsync, then we have to wait until the following one.

For non-WebRender, deserialization of Layers transactions happens on the compositor thread, and blocks the vsync message, so we can end up initiating compositing late if it takes a while.

It seems fairly arbtirary as to which things can delay vsync, and which things cause us to wait for the next.

Since this appears to be a source of slow frames, we can try experimenting with allowing compositing to start late if scene building finishes after it.

I think ideally we'd be able to detect when scene building is in progress when we get a vsync notification, and defer running the composite to when the scene building completes. I think that will be hard though, since the vsync notification is delivered to the root WebRenderBridgeParent, but only WRBP's for tabs know what scene building is in progress.

It might be simpler to detect the case where a scene build finishes within X ms of a skipped vsync, and then composite immediately.
(Assignee)

Comment 1

a month ago
Created attachment 9032549 [details]
Bug 1514640 - Use the vsync id of the skipped composite when we do a catch-up composite. r?jrmuizel
(Assignee)

Comment 2

a month ago
Created attachment 9032550 [details]
Bug 1514640 - Allow slow scene building to start a composite a bit late. r?jrmuizel

Depends on D15019
(Assignee)

Comment 3

a month ago
Created attachment 9032771 [details]
Bug 1514640 - Only allow late compositing if the content phase didn't happen in the same vsync. r?jrmuizel

Depends on D15020

Comment 4

a month ago
Pushed by mwoodrow@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/594b7dcaaf2d
Use the vsync id of the skipped composite when we do a catch-up composite. r=jrmuizel
https://hg.mozilla.org/integration/autoland/rev/2a55726134a0
Allow slow scene building to start a composite a bit late. r=jrmuizel
https://hg.mozilla.org/integration/autoland/rev/46ddda393092
Only allow late compositing if the content phase didn't happen in the same vsync. r=jrmuizel

Comment 5

a month ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/594b7dcaaf2d
https://hg.mozilla.org/mozilla-central/rev/2a55726134a0
https://hg.mozilla.org/mozilla-central/rev/46ddda393092
Status: NEW → RESOLVED
Last Resolved: a month ago
status-firefox66: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
Assignee: nobody → matt.woodrow
perf improvements:
== Change summary for alert #18414 (as of Fri, 21 Dec 2018 06:18:43 GMT) ==

Improvements:

 10%  raptor-motionmark-htmlsuite-firefox linux64-qr opt           53.15 -> 58.54
  6%  raptor-motionmark-animometer-firefox linux64-qr opt          36.04 -> 38.10
  3%  raptor-motionmark-htmlsuite-firefox windows10-64-qr opt      57.92 -> 59.63

For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=18414
You need to log in before you can comment on or make changes to this bug.