Open Bug 1689225 Opened 3 years ago Updated 2 years ago

Low FPS Scrolling on Touchpad (Windows 4k)

Categories

(Core :: Graphics: WebRender, defect)

Firefox 85
defect

Tracking

()

Performance Impact medium
Tracking Status
firefox85 --- affected

People

(Reporter: u658943, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: perf, perf:responsiveness)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0

Steps to reproduce:

Scroll on the touchpad with two fingers up and down on any webpage

Actual results:

Scrolling stutters a lot and drops significant frames, and ends up looking very choppy and unpleasant.
https://share.firefox.dev/3qXGLYJ

Expected results:

It should maintain 60fps like chromium does.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: perf

I should note that this issue is not exclusive or new to Firefox 85, it has existed for as long as I have used firefox regularly (or after quantum release). I can't speak for before that point.

I tried reproducing this issue on the latest versions of Firefox Nightly 87.0a1 (2021-02-01), beta 86.0b4 and release 85.0 but the scrolling had no issues for me on a Lenovo Yoga. This device though doesn't have a 4k monitor though.

Can you test the issue while in Safe Mode? You can find helpful info here : https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode .
Also a fresh new profile could help. You can find more about creating a new profile here : https://support.mozilla.org/en-US/kb/troubleshoot-and-diagnose-firefox-problems#w_6-create-a-new-firefox-profile .
If possible, you can test this issue on the nightly build as well. Download the build from : https://www.mozilla.org/en-US/firefox/nightly/all/ .

Flags: needinfo?(daphnei.mee)

(In reply to Andrei Purice from comment #2)

I tried reproducing this issue on the latest versions of Firefox Nightly 87.0a1 (2021-02-01), beta 86.0b4 and release 85.0 but the scrolling had no issues for me on a Lenovo Yoga. This device though doesn't have a 4k monitor though.

Can you test the issue while in Safe Mode? You can find helpful info here : https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode .
Also a fresh new profile could help. You can find more about creating a new profile here : https://support.mozilla.org/en-US/kb/troubleshoot-and-diagnose-firefox-problems#w_6-create-a-new-firefox-profile .
If possible, you can test this issue on the nightly build as well. Download the build from : https://www.mozilla.org/en-US/firefox/nightly/all/ .

Thanks for responding.

I have tested this in safe mode, where the issue is the same. I have tested this on a new profile. where the issue is present in the same way. I have tested this on release and nightly both in safe mode and on a new profile, where the issue is also present in the same way.I have also tried reinstalling graphics drivers. Notably, the issue is slightly less when my laptop is plugged in. It is still noticeably present, but it is slightly smoother.

Flags: needinfo?(daphnei.mee)

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

Component: Untriaged → Widget: Win32
Product: Firefox → Core

What page were you scrolling in the profile you uploaded? There are a huge amount of setTimeout/setIntervals in the profile which might explain what you are seeing. What exactly is causing those to happen would be the first thing to figure out.

Component: Widget: Win32 → Performance
Flags: needinfo?(tnikkel)
Flags: needinfo?(tnikkel) → needinfo?(daphnei.mee)

(In reply to Timothy Nikkel (:tnikkel) from comment #5)

What page were you scrolling in the profile you uploaded? There are a huge amount of setTimeout/setIntervals in the profile which might explain what you are seeing. What exactly is causing those to happen would be the first thing to figure out.

I'm really sorry about this, but I honestly don't remember which site it was in that profile.
I have recorded another profile on https://reddit.com (the new design) here https://share.firefox.dev/3qE2UvC, where I experienced similar frame drops and sluggishness when scrolling.

Flags: needinfo?(daphnei.mee)

Thanks for the new profile. There are still a ton of setTimeouts executing and there is a lot of content loading via the network. Are you just scrolling or is there content loading as well?

(In reply to Timothy Nikkel (:tnikkel) from comment #7)

Thanks for the new profile. There are still a ton of setTimeouts executing and there is a lot of content loading via the network. Are you just scrolling or is there content loading as well?

I was scrolling down the page while new content was loading in. Then I scrolled back up and down the page with fully loaded content.

I should also note that on recent nightly versions, this issue seems to be somewhat improved compared to version 85.

Hmm, there are a few places where page activity does seem to be slowing down APZ scrolling, e.g. here: https://share.firefox.dev/37AiKQi
I'm not sure why - scrolling is supposed to be asynchronous. And even if the page did have a non-passive wheel event listener, we should only block on it at the start of the wheel transaction. So I'm not sure what's happening there in the profile.
Also, there are very consistent MozMousePixelScroll events in the parent process, which indicates continuous 60Hz scrolling... and yet, only some of those scrolls have a corresponding "APZScroll Payload Presented" marker. Maybe the skipped scrolls have a delta of zero?

https://share.firefox.dev/3dxCeZH
Here is another example of the issue. I am on a brightspace page for a course I am taking. I can't specify the URL because it's personally identifiable to me.

(In reply to Markus Stange [:mstange] from comment #10)

Hmm, there are a few places where page activity does seem to be slowing down APZ scrolling, e.g. here: https://share.firefox.dev/37AiKQi

There's also the "no compositor screenshot because nothing changed" marker every single composite. Which seems wrong, unless the wording is incorrect and compositor screenshots were just disabled.

(In reply to Daphnei Mee from comment #8)

(In reply to Timothy Nikkel (:tnikkel) from comment #7)

Thanks for the new profile. There are still a ton of setTimeouts executing and there is a lot of content loading via the network. Are you just scrolling or is there content loading as well?

I was scrolling down the page while new content was loading in. Then I scrolled back up and down the page with fully loaded content.

Hmm, there is a lot of content loading throughout the profile, right up until the end.

(In reply to Timothy Nikkel (:tnikkel) from comment #13)

(In reply to Daphnei Mee from comment #8)

(In reply to Timothy Nikkel (:tnikkel) from comment #7)

Thanks for the new profile. There are still a ton of setTimeouts executing and there is a lot of content loading via the network. Are you just scrolling or is there content loading as well?

I was scrolling down the page while new content was loading in. Then I scrolled back up and down the page with fully loaded content.

Hmm, there is a lot of content loading throughout the profile, right up until the end.

I suppose it must have continued loading whatever it was loading offscreen.

Here is another profile where I know there is nothing loading https://share.firefox.dev/3qQLz2v
Taken from https://blog.mozilla.org/security/2021/02/23/total-cookie-protection/ on firefox 86

Moving to graphics because this seems related to that.

Component: Performance → Graphics
Whiteboard: [qf:p2:responsiveness]

(In reply to Sean Feng [:sefeng] from comment #16)

Moving to graphics because this seems related to that.

Hmm, why do you say that?

We did this in perf triage, because in the profile that Markus linked in the comment 10, there were some slow composites, so we thought this could be either Graphics or Panning and Zooming, and we decided to start with Graphics. Maybe Panning and Zooming is a better component for this issue?

Something of note is that this issue is much more present after I have had the firefox window open for a while, even if I close all but one tab. There seems to be a lot more stuttering after having had the window open for a while. And the stuttering only goes away after I close it and open it fresh.

Severity: -- → S3
Flags: needinfo?(botond)

Issue is still present on version 86 and latest nightly today.

Not sure if there's additional context I'm missing, but slow composites, every website being affected, and a 4k screen (==> lots more pixels to push) suggests a performance issue on the graphics / WebRender side.

Component: Graphics → Graphics: WebRender
Flags: needinfo?(botond)

This seems related to 1583881

Blocks: wr-perf
See Also: → 1583881

The RendererOGL::WaitForGPU (around 10.4s mark in Comment 11) seems weird to me. We shouldn't be waiting, ideally.

No longer blocks: gfx-triage
Performance Impact: --- → P2
Whiteboard: [qf:p2:responsiveness]
Blocks: wr-gpu-time
No longer blocks: wr-perf
You need to log in before you can comment on or make changes to this bug.