Closed Bug 1530505 Opened 6 years ago Closed 6 years ago

Scrolling on bugzilla.mozilla.org is not smooth

Categories

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

defect

Tracking

()

RESOLVED FIXED
Tracking Status
firefox67 --- affected

People

(Reporter: heftig, Assigned: gw)

References

(Blocks 2 open bugs)

Details

STR:

  1. Visit https://bugzilla.mozilla.org/show_bug.cgi?id=1530455
  2. Scroll down

Scrolling is not as smooth as on other pages.

Enabling picture-caching debugging shows the tiles are fixed to the viewport and don't scroll with the content.

Disabling the background on the <body> element (using style="background: none;") allows tiles to scroll but still repaints them constantly.

Note that bugzilla's page structure is such that it's not the root scroller that scrolls. Instead there's a scrollable div that does all the actual scrolling. So picture caching heuristics that try to detect the root scroller may not work.

Assignee: nobody → gwatson

(In reply to Jan Alexander Steffens [:heftig] from comment #0)

Scrolling is not as smooth as on other pages.

What hardware do you see the slowness on?

Flags: needinfo?(jan.steffens)

(In reply to Jeff Muizelaar [:jrmuizel] from comment #2)

What hardware do you see the slowness on?

Linux, GNOME on Wayland, Mesa DRI Intel(R) HD Graphics 530 (Skylake GT2) (i7-6820HK) and a UHD screen.

Other sites like about:support and http://www.csszengarden.com/215/ appear to scroll smoothly.

Strangely, the profiler claims 60 fps. With layout.frame_rate = 0, it manages about 70 fps scrolling on Bugzilla, 80 fps on http://www.csszengarden.com/215/ and 120 fps on about:support.

I'm not sure if MOZ_ENABLE_WAYLAND makes it feel better or worse. Maybe a vsync issue is making exacerbating the problem?

Flags: needinfo?(jan.steffens)

Notes from a quick look at the profiler:

(1) The vast majority of the GPU time is being spent in the gradient shader. There is a full-screen gradient background image. This is correctly identifying as opaque, but the current shader itself is really slow, especially when drawing a full 4k screen of pixels on integrated GPUs.

(2) There also appear to be some unexpected batching issues, where there are some solid background color fills that are running and filling the framebuffer before the full-screen gradient. This is wasted GPU time, since the gradient then completely overwrites these pixels.

(3) There are a total of 4 full-screen primitives drawn in the initial opaque pass - there are two additional primitives drawn after the initial background color + background gradient. It's not clear why these are needed yet, or what shader kind they are.


Profiling on my HD4600 at 4k on Linux:

  • Combined, the four primitives above take up 14.6 ms.
  • The total frame time is 19.4 ms.
  • Those 4 primitives make up ~75% of the total frame time.
  • Fixing those should get this page running well within frame budget.

For the gradient shader, there are several options:

  • Make it work like the border shader (that is, cache to a surface, and draw as an image during the scene).
  • Add a fast path gradient shader for common gradients (the existing gradient shader is slow because it handles an arbitrary number of color stops, which almost never happens).

For the batching, it seems likely to be a bug causing these items to overlap. If it's not a bug, we could consider a special shader path to combine multiple background rects / images / gradients in a single pass to reduce bandwidth requirements.

Note:
Optimizing the gradient shader has an additional benefit on every page we draw, since there are relatively expensive gradients drawn every frame in the main UI bars.

https://bugzilla.mozilla.org/show_bug.cgi?id=1533236 contains an optimization for simple gradients - this saves several ms of GPU time on this page. There's more ongoing work to resolve the other issues discussed above.

Is this still slow for you?

Blocks: wr-perf, wr-intel
Flags: needinfo?(jan.steffens)
Priority: -- → P3

Much improved! The picture caching issue is still there, but scrolling is smooth almost all the time.

Flags: needinfo?(jan.steffens)

Great. Let's mark this as fixed then.

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