Closed Bug 1627458 Opened 4 years ago Closed 3 years ago

Bad performance around covid map on theguardian.com

Categories

(Core :: Graphics: WebRender, defect, P3)

76 Branch
defect

Tracking

()

RESOLVED WORKSFORME
Performance Impact high
Tracking Status
firefox76 --- wontfix

People

(Reporter: mayankleoboy1, Unassigned)

References

(Blocks 1 open bug, )

Details

(Keywords: perf:resource-use, Whiteboard: [wfh])

Attachments

(2 files)

+++ This bug was initially created as a clone of Bug #1627453 +++

Enable WR
Go to the URL
Scroll on the page

ER: Smooth scrolling
AR: When the interactive map of the USA is on the screen, the scrolling is very janky

Scrolling with the touchpad : https://perfht.ml/3aJkB4W

Depends on: 1627459
No longer depends on: 1627459
See Also: → 1627459
Attached file about:support

Nical, just NI-ing you here to look at for perf triage at some point

Blocks: wr-perf
Flags: needinfo?(nical.bugzilla)
Priority: -- → P3

The janky frames have more than 2k draw calls, looks like a batching issue.

Blocks: wr-batching-perf
No longer blocks: wr-perf
Flags: needinfo?(nical.bugzilla)
Type: task → defect
Summary: Scrolling is very janky on a page on theguardian.com when the map is visible on the screen → Bad performance around covid map on theguardian.com

Also each dot on the map goes into its own blob image. making various things slow a allocating a ton of texture memory since the slab allocator wastes a lot of memory for each tiny allocation.

Flags: needinfo?(jmuizelaar)
Attached file Just the map
Flags: needinfo?(jmuizelaar)

It looks like it's this code https://searchfox.org/mozilla-central/source/gfx/layers/wr/WebRenderCommandBuilder.cpp#1140 and aParentActive = true that's making all of the dots active.

Summary from the matrix discussion:

  • Each dot has mix-blend:multiply causing a thousands draw calls intrelaved with read-backs.
  • CSS mix-blend modes are hard to implement with hardware blending equations because of the extra over step.
  • It can be implemented in a single pass with the texture barrier extension provided the shader reads and writes the same pixel at each invocation (which is the case).
  • the other approach is to say there is only so much we can do to make this type of content fast, and try to mitigate the issue with more efficient caching/invalidation. At the moment invalidating a piece of the map appears to invalidate all picture cache tiles overlapping with the map.

Doing both the texture barrier optimization and imprving invalidation would be valuable.

If we can't use the texture barrier extension, we could in principle batch together mix-blend elements that don't overlap, but I suspect it wouldn't be enough.

Whiteboard: [qf]

Marking qf:p1 for the same reason as https://bugzilla.mozilla.org/show_bug.cgi?id=1627453#c9

Whiteboard: [qf] → [qf:p1:resource]
Whiteboard: [qf:p1:resource] → [qf:p1:resource][wfh]

Because this bug's Severity has not been changed from the default since it was filed, and it's Priority is P3 (Backlog,) indicating it has been triaged, the bug's Severity is being updated to S3 (normal.)

Severity: normal → S3

We tested the site again on both desktop and Andriod, looks like it's no longer an issue, so closing this out.

Please free feel to reopen!

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WORKSFORME

Glenn and Nical, we did a lot of work on mix-blend since a year ago, and also specifically some things to make mix-blend:multiply fast even on hardware without advanced-blend-equation support. Does that seem like what likely resolved this here?

Performance Impact: --- → P1
Whiteboard: [qf:p1:resource][wfh] → [wfh]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: