Closed Bug 1437556 Opened 7 years ago Closed 4 years ago

Canvas performance on Mac is worse with WR than Layers

Categories

(Core :: Graphics: WebRender, enhancement, P2)

enhancement

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: jrmuizel, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

We're not using SkiaGL, but also it seems like we could be doing better even in software.

https://jrmuizel.github.io/webrender/perf/canvas-perf.html

https://perfht.ml/2o0kpH7
This is WebRender specific?  As in, it got worse from Skia (not SkiaGL) without WR?
Priority: -- → P2
In current implementation, SkiaGL is used only with LayersBackend::LAYERS_OPENGL.
Depends on: 1438079
Created Bug 1438079 to enable SkiaGL on mac.
Depends on: 1411481
Blocks: wr-mac
No longer blocks: stage-wr-trains
SkiaGL was disabled by Bug 1468801.
See Also: → 1468801
Can we quantify what we mean here? The linked benchmark is not representative of real content, and would be the pessimal case for software canvas.

Can we either pick a different benchmark (or set of benchmarks), or alternatively narrow the scope of this bug to 'large canvas2d clears are slow' and decide whether to WONTFIX that specific case?
Flags: needinfo?(jmuizelaar)
This bug is just meant to ensure that we're not regressing canvas2d performance on Mac with WebRender.
Flags: needinfo?(jmuizelaar)
Can you re-test now that we've dropped SkiaGL, since WR lacking SkiaGL was the likely cause here?
Flags: needinfo?(jmuizelaar)
Summary: Canvas performance is bad on Mac → Canvas performance on Mac is worse with WR than Layers
Dropping the n-i as this is important right now.
Flags: needinfo?(jmuizelaar)

According to [1], canvas performance is still an issue on mac with webrender enabled.

[1] https://www.reddit.com/r/firefox/comments/brw6c7/post_your_webrender_results/eoo3nnz?utm_source=share&utm_medium=web2x

Blocks: wr-mac-block
No longer depends on: wr-mac-block

Miko, when you are done your current task, can you help investigate this to see if it is indeed a problem?

Flags: needinfo?(mikokm)

On 80.0a1 I'm seeing the expected results on the Chalkboard benchmark (13" MBP):

With WebRender: 7.03 seconds / 6.97 seconds / 6.96 seconds

Without WebRender (webrender.force-disable true): 22.89 seconds / 23.14 seconds / 22.87 seconds

With WebRender, the attached test case runs at a steady 32 FPS (via webrender.debug.profiler).

Without WebRender it maxes out at 26 FPS (via layers.acceleration.draw-fps).

Looking for more tests, I did find some differences on CanvasMark 2013 between WR on/off:
http://www.kevs3d.co.uk/dev/canvasmark/
About half the tests are slower with WR enabled.

Focusing just on the Plasma test, I wonder if possibly some of this is due to lower clock speeds, where having WR enabled allows running more efficiently. When the CPU clock with WR-on boosts to the same value as WR-off, it achieves the same benchmark score on the plasma test; the problem is that after the first spike, it stops boosting, whereas with WR-off it never reaches that level of efficiency.

Just a thought.

Plasma test with WR off.
The ~2Ghz line is the idle "press space bar to start". The two peaks are two runs, both hitting ~3.9Ghz.

Plasma test with WR-on. The first peak (at about the midpoint of the graph) is the first run, it gets a similar score. The 2nd peak (at about 75% on the X-axis) got a score 33% lower.

(In reply to Bert Peers [:bpeers] from comment #11)

On 80.0a1 I'm seeing the expected results on the Chalkboard benchmark (13" MBP):

With WebRender: 7.03 seconds / 6.97 seconds / 6.96 seconds

Without WebRender (webrender.force-disable true): 22.89 seconds / 23.14 seconds / 22.87 seconds

With WebRender, the attached test case runs at a steady 32 FPS (via webrender.debug.profiler).

Without WebRender it maxes out at 26 FPS (via layers.acceleration.draw-fps).

I am getting similar numbers. On my 15" MBP WebRender is a lot faster, especially with a 4K monitor.

Jeff's testcase: Non-WR: 32 FPS, WR: 75 FPS.
Chalkboard: Non-WR: 47 seconds , WR: 2.7 seconds (Yes, these are correct numbers that were measured multiple times)

Flags: needinfo?(mikokm)

It seems that Jeff's testcase was improved by client storage patches of bug 1536515. These took the test from 13 FPS to 60 FPS.

If https://testdrive-archive.azurewebsites.net/performance/chalkboard/ is the Chalkboard benchmark that is being referred to, I'm pretty sure that doesn't use canvas.

After Miko re-lands client texture stuff, we will do further testing to see how we are doing.

(In reply to Jessie [:jbonisteel] pls NI from comment #18)

After Miko re-lands client texture stuff, we will do further testing to see how we are doing.

Client storage was re-enabled in today's Nightly, and the testcase still looks good.

I also benchmarked WebRender on/off in MotionMark canvas tests, and it seems that WebRender is doing better with both integrated and discrete GPUs on my 2019 MBP. Interestingly, it seems that Intel with the laptop screen benefits more from WebRender than AMD with an external 4K monitor.

WR on AMD: 987, 963
WR off AMD: 935, 905

WR on Intel: 801, 784
WR off Intel: 690, 672

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: