Laggy scrolling on Android

Hello,

With the latest update 1b5f26e0ab I used all day and the problem appear yesterday night. So I think the issue in one of the last few commits.

It seems to happens when I touch and start scrolling. The scrolling is not start immediately.

The issue seems to only on Android on both view (mobile and desktop) and the PWA and browser too.

It affect on the whole site where scrolling available.

My device:
Android 10
Chrome 96.0.4664.45

Thanks :slightly_smiling_face:

3 Likes

This is very interesting, thanks for reporting! As far as Iā€™m aware, the only recent commit which affects scrolling would be:

But if anything, I would have expected that to make scrolling smoother, not worse! (I switched this particular feature to use ā€˜passiveā€™ event listeners, rather than blocking event listeners)

Do you have the same problem on try.discourse.org?

As an experiment, I just made a theme here on Meta which removes those updated event listeners. https://meta.discourse.org/?preview_theme_id=260 (Named ā€œExperiment - remove scroll listenerā€ in the hamburger) Does this theme fix the lagging for you?

3 Likes

Hi David,

Thank you for the quick response. Unfortunately there is the same issue on try and the Experiment - remove scroll listener theme too. :confused:

2 Likes

Thanks for checking! In a way Iā€™m glad that didnā€™t fix it, because I have no idea why that change would cause worse performance! :sweat_smile:

Iā€™ll do another comb through recent commits and see if I can spot anything suspicious :eyes:

Would you mind letting us know the make/model of your device, so I can try to reproduce in a simulator?

2 Likes

On second thought, yes, it is positive :grinning:

Sure my device is a Huawei P20 Pro :slightly_smiling_face:

2 Likes

Cant repro this on my phone on either Chrome or Firefox.

4 Likes

I can repro here on Meta using my Pixel 4 XL running Android 12. I didnā€™t notice it until I read this topic. The best way to see it is to scroll short distances (~2cm on the screen) repeatedly.

3 Likes

I made this improvement:

Which is now deployed to meta. Does that feel any better @Don?

That issue isnā€™t new though, so Iā€™m not sure why it only started being noticeable in the last couple of days :thinking:

6 Likes

David now it is perfect :slightly_smiling_face: Thank you!

I saw yesterday a commit about software update prompt :thinking: Maybe that is related with this issue?

5 Likes

Glad to hear it!

Oh yes, youā€™re absolutely right! I totally missed that. This commit from yesterday refactored the --header-offset logic so that it runs all the time, rather than ā€˜only when dockedā€™. That slowed down scroll performance. My fix made that logic more efficient, so thatā€™s why itā€™s working now. :+1:

8 Likes