Closed Bug 1690840 Opened 4 years ago Closed 4 years ago

modified testcase from bug 1690835 takes a lot of CPU in WR compared to non-WR (35% of WRRenderBackend spent in AlphaTextureTarget)

Categories

(Core :: Graphics: WebRender, defect)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: mayankleoboy1, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

use WR in Nightly
Open the attached testcase

ER: low CPU use
AR: high CPU use

All I changed from the original testcase from bug 1690835 is to change the CSS like so :

Original : font-size: 50px;
Modified : font-size: 250px;

Attached file about:support
See Also: → 1690835
Attached file testcase.html

https://share.firefox.dev/2MQnhXk

35% of WRRenderBackend spent in some AlphaTextureTarget

Summary: modified testcase from bug 1690835 takes a lot of CPU in WR compared to non-WR → modified testcase from bug 1690835 takes a lot of CPU in WR compared to non-WR (35% of WRRenderBackend spent in AlphaTextureTarget)

This is "DWriteGlyphRunAnalysis::CreateAlphaTexture" more specifically. I wonder if we are applying the transformations to the glyph themselves, instead of applying them post-rasterization in our shaders. Maybe Lee has thoughts.

Blocks: wr-perf
Severity: -- → S3
Flags: needinfo?(lsalzman)

Can you get a profile from non-WR that I can compare with?

Flags: needinfo?(lsalzman) → needinfo?(mayankleoboy1)

My suspicion here is just that due to the large font size, you are seeing a different between how Skia and WR render large glyphs. Above a certain size threshold, Skia draws glyphs as paths, whereas WR continues to draw them as glyphs. We can't draw them as paths in WR because currently we don't have a GPU-accelerated solution for drawing paths in WR. This is most likely the cause of the divergence in CPU usage you are seeing, but I would have to see a comparison profile to be sure.

Severity: S3 → S4
Flags: needinfo?(mayankleoboy1) → needinfo?(lsalzman)
Attached file non-wr about:support

It doesn't look like that profile has all the content process threads in them. Can you try getting a profile with the Firefox Graphics preset in the profiler?

Flags: needinfo?(lsalzman)

new profile : https://share.firefox.dev/2YNhDYP
the content process has pid of 15116
(The previous profile had the cintent process, but the profiler chose to hide it by default. Maybe because it had no activity?)

Flags: needinfo?(lsalzman)

(In reply to Mayank Bansal from comment #7)

non-WR : https://share.firefox.dev/2YPbhYR

Modified the profile to show the relavent content process : https://share.firefox.dev/3jmGJqR

Hiro, it looks like we're getting animation compositor animation and no invalidation here in the layers case, but we get invalidation in the WR case, any idea why?

Flags: needinfo?(lsalzman) → needinfo?(hikezoe.birchill)

https://share.firefox.dev/3p1XVTB

This is fixed. Most probably by bug 1690835

Status: NEW → RESOLVED
Closed: 4 years ago
Flags: needinfo?(hikezoe.birchill)
Resolution: --- → FIXED
Depends on: 1690835
See Also: 1690835

(I wrote a comment but forgot to publish it, here is the comment, I was going to add Glenn in CC list and he fixed the issue! Wonderful!)
(here is the comment)

I am afraid I don't know about the invalidation stuff either on WR or non WR. CCing Glenn (though I assume why Lee asked me is that he wanted to know the reason why non WR doesn't invalidate).

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

Attachment

General

Creator:
Created:
Updated:
Size: