Closed Bug 1514640 Opened 2 years ago Closed 2 years ago

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


(Core :: Graphics: WebRender, enhancement)

Not set



Tracking Status
firefox66 --- fixed


(Reporter: mattwoodrow, Assigned: mattwoodrow)




(3 files)

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

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.
Pushed by
Use the vsync id of the skipped composite when we do a catch-up composite. r=jrmuizel
Allow slow scene building to start a composite a bit late. r=jrmuizel
Only allow late compositing if the content phase didn't happen in the same vsync. r=jrmuizel
Assignee: nobody → matt.woodrow
perf improvements:
== Change summary for alert #18414 (as of Fri, 21 Dec 2018 06:18:43 GMT) ==


 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:
You need to log in before you can comment on or make changes to this bug.