Bug 153111 - Terrible performance when scrolling on Wayland
Summary: Terrible performance when scrolling on Wayland
Status: RESOLVED DUPLICATE of bug 152911
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
7.4.3.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: perf
Depends on:
Blocks: Wayland KDE, KF5 Scrolling-Performance
  Show dependency treegraph
 
Reported: 2023-01-19 19:56 UTC by linus.kardell
Modified: 2024-04-24 15:10 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description linus.kardell 2023-01-19 19:56:43 UTC
Description:
When I run Libreoffice on, and scroll rapidly back and forth, the performance rapidly drop. Basically, I use two-finger scroll on the touchpad, and rapidly move the fingers back and forth between the bottom and top of the touchpad. The longer I keep doing it, the lower the framerate gets, and if I keep doing it for a while the framerate drops so low that the window is marked as unresponsive. The performance then returns to normal if I stop scrolling for a few seconds. It's easiest to reproduce in Calc, but it happens in other components as well, such as long Writer documents.

Steps to Reproduce:
1. Open Calc on Plasma Wayland
2. Start scrolling rapidly back and forth

Actual Results:
Performance drops severely

Expected Results:
Performance stays as normal


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Operating System: openSUSE Tumbleweed 20230113
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.101.0
Qt Version: 5.15.8
Kernel Version: 6.1.4-1-default (64-bit)
Graphics Platform: Wayland
Processors: 8 × AMD Ryzen 7 3700U with Radeon Vega Mobile Gfx
Memory: 29.3 Gibyte of RAM
Graphics Processor: AMD Radeon Vega 10 Graphics
Manufacturer: Acer
Product Name: Aspire A315-41
System Version: V1.18
Comment 1 Stéphane Guillou (stragu) 2023-01-19 21:08:33 UTC
Thanks Linus.
Do you use some scaling or High DPI setting for your OS/DE display settings?

Please also paste here the info copied from Help > About LibreOffice.
Comment 2 linus.kardell 2023-01-20 19:02:54 UTC
Version: 7.4.3.2 / LibreOffice Community
Build ID: 40(Build:2)
CPU threads: 8; OS: Linux 6.1; UI render: default; VCL: kf5 (cairo+wayland)
Locale: sv-SE (sv_SE.UTF-8); UI: sv-SE
Calc: threaded

I can reproduce the issue regardless of whether scaling is enabled or disabled.
Comment 3 Corentin Fleury 2023-04-22 20:28:47 UTC
Version: 7.4.6.2
Build ID: 40(Build:2)
CPU threads: 12; OS: Linux 6.2; UI render: default; VCL: kf5 (cairo+wayland)
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Calc: threaded

I can also reproduce this bug in writer and it is very annoying as the larger the documents gets, the more laggy the scroll becomes.
Comment 4 M. Knepper 2023-05-17 18:56:58 UTC
(In reply to linus.kardell from comment #2)
> Version: 7.4.3.2 / LibreOffice Community
> Build ID: 40(Build:2)
> CPU threads: 8; OS: Linux 6.1; UI render: default; VCL: kf5 (cairo+wayland)
> Locale: sv-SE (sv_SE.UTF-8); UI: sv-SE
> Calc: threaded
> 
> I can reproduce the issue regardless of whether scaling is enabled or
> disabled.

I can reproduce this, as well. It's especially worse at larger resolutions.
Comment 5 Stéphane Guillou (stragu) 2023-05-17 21:27:54 UTC
(In reply to jake.m.knepper from comment #4)
> I can reproduce this, as well. It's especially worse at larger resolutions.

Jake, can you please also paste here the information copied from Help > About LibreOffice?

All: did this start in version 7.4? Are you able to test earlier versions to let us know if this is a regression?
https://downloadarchive.documentfoundation.org/libreoffice/old/
Comment 6 M. Knepper 2023-10-19 17:23:34 UTC
(In reply to Stéphane Guillou (stragu) from comment #5)
> (In reply to jake.m.knepper from comment #4)
> > I can reproduce this, as well. It's especially worse at larger resolutions.
> 
> Jake, can you please also paste here the information copied from Help >
> About LibreOffice?
> 
> All: did this start in version 7.4? Are you able to test earlier versions to
> let us know if this is a regression?
> https://downloadarchive.documentfoundation.org/libreoffice/old/

I am so sorry that I am just now seeing this.

To update: this problem still exists on Fedora 38 and the Fedora 39 beta.


I've updated my hardware, too. Right now I have a 13700k, 32GB DDR5 7200mhz ram, and an RX 7900 XT. 

To replicate, all you need is a 4k monitor.

1. Makes sure your resolution is set to 4k (3840x2160).
2. Open LibreOffice writer.
3. Open a multi-page document of any kind.
4. Begin scrolling.
5. Observe a 50% usage of one or two CPU cores and laggy, choppy performance.

This does not happen on Microsoft word - when scrolling on MS Word, the the CPU usage (as well as GPU usage) stays around 3% tops on any given core. It's also not laggy at all.
Comment 7 Stéphane Guillou (stragu) 2023-12-15 09:18:36 UTC
(In reply to M. Knepper from comment #6)
Please also share the information copied from Help > About LibreOffice, as it tells us which VCL plugin you are using, which seems to matter with this issue.
Which desktop environment do you use? How are you using MS Word on Fedora?
Comment 8 Stéphane Guillou (stragu) 2023-12-15 09:21:33 UTC
(In reply to linus.kardell from comment #2)
> I can reproduce the issue regardless of whether scaling is enabled or
> disabled.

(In reply to Corentin Fleury from comment #3)
> I can also reproduce this bug in writer and it is very annoying as the
> larger the documents gets, the more laggy the scroll becomes.

Linus and Corentin:
- What size displays are you using?
- Does turning off Automatic Spell Checking have any impact?
Comment 9 linus.kardell 2023-12-15 20:50:36 UTC
Version: 7.6.3.1 (X86_64) / LibreOffice Community
Build ID: 60(Build:1)
CPU threads: 8; OS: Linux 6.6; UI render: default; VCL: kf5 (cairo+wayland)
Locale: sv-SE (sv_SE.UTF-8); UI: sv-SE
Calc: threaded

I'm on a 1920x1080 screen, with Calc maximized. Turning off spell check does not seem to help.
Comment 10 Michael Weghorn 2023-12-22 20:24:29 UTC
The discussion in https://gerrit.libreoffice.org/c/core/+/161184/comments/48b136e2_b406d494 may (or may not) be relevant here:

Patricky Luby wrote:
> I did see lagging scrollbar thumb drawing in tdf#155266. Those I had to fix in
> the macOS native event dispatch code by adding more SalFrame::Flush() calls
> after handling a left mouse drag or scrollwheel events. Maybe a similar lack of
> flushing is occurring with Wayland on Linux and/or Windows?
Comment 11 Jeff Fortin Tam 2024-03-23 00:37:04 UTC
Presuming this happens with some document types more than others, and that it still happens for you in 24.2, do you have a "particularly bad" document sample you could provide here that would make it easy for someone like me to test and profile this? Because so far I'm unable to reproduce this with open source AMD graphics with:

Version: 24.2.1.2 (X86_64) / LibreOffice Community
Build ID: db4def46b0453cc22e2d0305797cf981b68ef5ac
CPU threads: 8; OS: Linux 6.7; UI render: default; VCL: gtk3
Flatpak
Calc: threaded
Comment 12 Buovjaga 2024-04-24 15:10:53 UTC

*** This bug has been marked as a duplicate of bug 152911 ***