Open Bug 1745050 Opened 4 years ago Updated 2 years ago

https://acko.net/files/slacko/ is very slow when scrolling, much jank

Categories

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

Firefox 94
defect

Tracking

()

UNCONFIRMED
Performance Impact medium

People

(Reporter: gregp, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: perf:responsiveness)

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0

Steps to reproduce:

Visit https://acko.net/files/slacko/
Scroll

Actual results:

bad choppy scroll

Expected results:

good smooth scroll

The Bugbug bot thinks this bug should belong to the 'Core::Panning and Zooming' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Panning and Zooming
Product: Firefox → Core

Moving to Performance component for initial investigation.

If you can share a performance profile taken with the Firefox Profiler that would be helpful.

Component: Panning and Zooming → Performance

(In reply to Botond Ballo [:botond] from comment #2)

Moving to Performance component for initial investigation.

If you can share a performance profile taken with the Firefox Profiler that would be helpful.

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

Janking in the renderer thread -> GFX.
(when tested locally)

Component: Performance → Graphics

I can also reproduce this on Windows. Additional profile: https://share.firefox.dev/3tO8Giz

Whiteboard: [qf:p2:responsiveness]

The severity field is not set for this bug.
:bhood, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(bhood)

Glenn, could you please have a look at this?

Severity: -- → S3
Flags: needinfo?(bhood) → needinfo?(gwatson)
Priority: -- → P2

This shows the render target allocations - we can see that each of the 3d segments is allocating quite a large surface, and there are a lot of them.

There's a few things going on here, all related - this gives us a rough idea why it's janking, but will need some deeper investigation to find the exact cause.

Things to note:

  • Each of the 3d elements at the top is a different render target due to the preserve-3d context.

  • We are allocating surface sizes much larger than they need to be (this is based on a scale factor estimation of screen size of the element, which can currently overestimate required size, expecially when perspective such as the above is present).

  • Since these elements are only rectangles (solid colors), we could actually allocate them to be 16x16 without any quality loss here. We don't currently detect this, and it's a bit of a special case / hack, but it might be worth doing to handle cases like this really well.

  • When (smooth) scrolling the number of render targets changes a lot each frame - it may be that we're hitting driver stalls from re-configuring the render target pool each frame.

  • There are a number of gfx warnings from the renderer each frame, such as [GFX1-]: Failed to allocate a surface due to invalid size (CDT) Size(0,0) (t=153.261). This is probably due to an edge case where a 3d element is added to the draw lists but ends up clipped or scaled to 0 due to the perspective present.

Fixing one or all of the above issues should resolve the performance problems here.

Flags: needinfo?(gwatson)

This article explains many implementation details of the site
https://acko.net/blog/making-love-to-webkit/
The Scene Editor seems to cause the same jank present in the site

Performance Impact: --- → P2
Whiteboard: [qf:p2:responsiveness]
Component: Graphics → Graphics: WebRender

Bug 1764875 improved this significantly (the browser UI itself no longer janks when loading the page, etc.), unfortunately I can't really say the problem is fixed, a very bad jumpiness is still present in the animation. https://share.firefox.dev/3vyPKoq

Depends on: 1764875

From a quick look at the most recent profile, it doesn't appear to be GPU related. It looks like there is jank in the content process from JS / layout / DL building. Markus, does that look right to you?

Flags: needinfo?(mstange.moz)

I see some 30ms+ frame building times: https://share.firefox.dev/3kC4g8F
But I agree that the bigger problem is on the main thread. https://share.firefox.dev/3vFA8Q4
Two things that stand out are the large number of samples spent in functions with the word "Matrix", and the time spent in the allocator inside ClipManager::BeginList.

Flags: needinfo?(mstange.moz)
See Also: → 1825663
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: