Closed Bug 1632283 Opened 5 years ago Closed 4 years ago

Improve WebGL IpdlQueue Performance

Categories

(Core :: Graphics: CanvasWebGL, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: handyman, Assigned: handyman)

References

Details

Attachments

(2 files)

IpdlQueue can batch at least most async WebGL messages to the compositor process. This will lead to far fewer IPDL Send calls and improve latency is many cases. The async buffer should be flushed on (1) a synchronous call or (2) on demand. We'll need something like a recurring task that flushes to make sure that we don't starve the buffer.

IpdlQueue currently sends an async Ipdl message for every async WebGL call. This is a lot of overhead. This patch buffers those calls so that they can be send in large batches when either a synchronous call happens or the client calls FlushAsyncCache. The commands are then sent and processed in-order.

Attachment #9142537 - Attachment description: WIP Bug 1632283 : Part 1 - Extend IpdlQueue to allow caching async messages → Bug 1632283 : Part 1 - Extend IpdlQueue to allow caching async messages r=jgilbert!

When an async message is buffered, we need to make sure that the message is eventually sent to avoid starvation. This patch queues a future task to do this (currently, randomly, 4 milliseconds in the future) unless one is already queued. The task may get scooped by a sync message or user call to FlushAsyncCache, in which case the task will have no effect.

Depends on D72047

Pushed by daparks@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7e47a8d17381 Part 1 - Extend IpdlQueue to allow caching async messages r=jgilbert

rebased

Flags: needinfo?(davidp99)
Pushed by daparks@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8cfbadcbe2e8 Part 1 - Extend IpdlQueue to allow caching async messages r=jgilbert https://hg.mozilla.org/integration/autoland/rev/bad8fd79458d Part 2 - Add task to drain WebGL async Ipdl queue r=jgilbert
Pushed by daparks@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/813b662b4ded Part 1 - Extend IpdlQueue to allow caching async messages r=jgilbert https://hg.mozilla.org/integration/autoland/rev/6b31077ebd14 Part 2 - Add task to drain WebGL async Ipdl queue r=jgilbert
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: