Open Bug 2096586 Opened 5 days ago Updated 1 day ago

18.2 - 8.43% pdfpaint_main_hwa perf_transparency_groups.pdf + 3 more (Linux, OSX) regression on Thu November 19 2026

Categories

(Core :: Graphics: Canvas2D, defect)

defect

Tracking

()

ASSIGNED
Tracking Status
firefox-esr115 --- unaffected
firefox-esr153 --- unaffected
firefox161 --- unaffected
firefox162 --- fix-optional
firefox163 --- affected

People

(Reporter: performance-sheriff-bot, Assigned: mstange)

References

(Depends on 1 open bug, Regression)

Details

(4 keywords)

Perfherder has detected a talos performance regression from push 656225c902902e93a12e97c06ba0160901c71cdc. As author of one of the patches included in that push, we need your help to address this regression.

Please acknowledge, and begin investigating this alert within 3 business days, or the patch(es) may be backed out in accordance with our regression policy.

Regression Test Platform Options Absolute values [old vs new]
18% pdfpaint_main_hwa perf_transparency_groups.pdf (doc) macosx1500-aarch64-shippable e10s fission stylo webrender 102.44 ms -> 121.09 ms
12% pdfpaint_main_hwa perf_transparency_groups.pdf (doc) linux2404-64-shippable e10s fission stylo webrender 247.08 ms -> 276.14 ms
9% pdfpaint_main_hwa perf_transparency_group_stacks.pdf (doc) macosx1500-aarch64-shippable e10s fission stylo webrender 202.92 ms -> 221.57 ms
8% pdfpaint_main_hwa perf_transparency_group_stacks.pdf (doc) linux2404-64-shippable e10s fission stylo webrender 370.72 ms -> 401.98 ms
Improvement Test Platform Options Absolute values [old vs new]
7% perf_reftest_singletons random-font-sizes-1.html (doc) macosx1500-aarch64-shippable e10s fission stylo webrender 40.26 ms -> 37.40 ms
6% perf_reftest_singletons random-font-sizes-1.html (doc) linux2404-64-shippable e10s fission stylo webrender 130.03 ms -> 122.80 ms

Support & Actionable Steps

For questions, please contact afinder@mozilla.com. You can also find help on Slack (#perf-help) or Matrix (#perftest).

Action guide details:

Flags: needinfo?(mstange.moz)

Set release status flags based on info from the regressing bug 2094308

Bug 2094308 made some cases faster but other cases slower.

The regression is in perf_transparency_groups.pdf in the accelerated variant (pdfpaint_main_hwa). The software variant (pdfpaint_main_sw) did not move.

pdf.js draws "knockout groups" in this PDF with three canvases:

  • P is the parent canvas. It is large, so it is accelerated.
  • G is the canvas for the transparency group. It is small (below gfx.canvas.accelerated.min-size).
  • backdropEntry is a small scratch canvas that pdf.js creates for every fill inside the group.

For every fill, pdf.js does this:

  1. G was initialized earlier by a clip(), before anything was drawn into it, so it is a software canvas.
  2. backdropEntry is initialized with a drawImage() of a subregion of P.
  3. backdropEntry is drawn into G.

Before bug 2094308, backdropEntry was a software canvas. Step 2 needed a synchronous readback of P, and step 3 was a software copy. P does not change while the group is drawn, so that readback could probably be reused across fills.

After bug 2094308, backdropEntry is accelerated, because its first operation draws from an accelerated canvas. Step 2 is now a GPU copy, but step 3 needs a synchronous readback of backdropEntry. backdropEntry changes on every fill, so this readback happens once per fill. Each readback waits for all canvas work queued before it in the GPU process, and it blocks the content main thread. In the profiles, look for CanvasDrawEventRecorder::WaitForCheckpoint on the content process main thread:

Making canvases of all sizes accelerated would solve this. Locally, gfx.canvas.accelerated.min-size=0 brings this test from about 127 ms to about 30 ms, and the readback waits disappear (profile). But the PerfCompare shows MotionMark regressions on all platforms.

Now I'm trying to make software canvases remote too. Small canvases would then draw with software in the GPU process. Drawing one canvas into another then happens entirely in the GPU process, without a readback to the content process.

Assignee: nobody → mstange.moz
Status: NEW → ASSIGNED
Flags: needinfo?(mstange.moz)

(In reply to Markus Stange [:mstange] from comment #2)

Making canvases of all sizes accelerated would solve this. Locally, gfx.canvas.accelerated.min-size=0 brings this test from about 127 ms to about 30 ms, and the readback waits disappear (profile). But the PerfCompare shows MotionMark regressions on all platforms.

The regressions are all on the "Images" subtest, which has small canvases and readbacks, and the canvases are not initialized with willReadFrequently. So maybe we don't care about regressing it? Jeff's PR to add willReadFrequently is still open: https://github.com/WebKit/MotionMark/pull/1

Making all software canvases remote (except the ones with willReadFrequently) definitely fixes the PDF regression in this bug. But it also makes MotionMark "Images" slower, though much less so than removing the minimum size for acceleration.

PerfCompare with min-size=0, PerfCompare with remote software

On many PDF tests, remote software canvases perform much better than accelerating all canvases:

Test Platform min-size=0 remote software
perf_transparency_groups.pdf macOS 120 → 159 ms (+33%) PC 121 → 35 ms (−71%) PC
Linux 278 → 117 ms (−58%) PC 277 → 98 ms (−64%) PC
Windows 125 → 126 ms (flat) PC 118 → 52 ms (−56%) PC
perf_transparency_group_stacks.pdf macOS 216 → 64 ms (−71%) PC 212 → 59 ms (−72%) PC
Linux 405 → 223 ms (−45%) PC 358 → 191 ms (−47%) PC
Windows 273 → 283 ms (+3%) PC 154 → 110 ms (−29%) PC
perf_images_stencil_masks.pdf macOS 46 → 146 ms (+221%) PC 45 → 24 ms (−47%) PC
Linux 182 → 435 ms (+139%) PC 175 → 79 ms (−55%) PC
Windows 90 → 89 ms (flat) PC 97 → 46 ms (−53%) PC

(On Windows, gfx.canvas.accelerated.min-size=0 has no effect, I believe we are still using D2D canvas there?)

Depends on: 2098754
You need to log in before you can comment on or make changes to this bug.