Bug 157830 - When scrolling a document at a resolution of 4k, CPU usage jumps to 50% or more and performance is laggy/choppy.
Summary: When scrolling a document at a resolution of 4k, CPU usage jumps to 50% or mo...
Status: RESOLVED DUPLICATE of bug 154602
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.6.2.1 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: perf
Depends on:
Blocks:
 
Reported: 2023-10-19 17:34 UTC by M. Knepper
Modified: 2024-03-12 04:55 UTC (History)
3 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 M. Knepper 2023-10-19 17:34:35 UTC
This is pretty easy to replicate.

LibreOffice version: 7.4, 7.5, 7.6 (exits in Flatpak versions and native versions, such as .deb and .rpm)

Hardware I've tested this on (different distros listed and tested on each one):
Machine #1: 2700x, RX 580, DDR4 16GB 3200mhz RAM (Debian 12/Linux Mint 21/Fedora 38/KDE Neon)
Machine #2: 13700k, RX 7900 XT, DDR5 32GB 7200mhz RAM (Ubuntu 23.10/Fedora 38/Fedora 39 Beta/Most recent version of MX Linux)

I used a 40 page document, both in .odt and .docx. Results were the same.

To replicate (it is CRITICAL to test for this bug at 4k - 1920x1080 is too low of a resolution and won't reproduce the result!):
1. Make sure display resolution is set to 3840x2160 (4k).
2. Open LibreOffice Writer.
3. Open any multi-page document, the bigger the better.
4. Scroll.
5. Observe that CPU usage of a core or two will spike well beyond 50% or more.
6. Observe choppy, laggy performance - your fans might even spin up on the CPU to compensate for the high usage.

Increasing resolution definitely makes it worse.

Setting scaling to 200% or 150% also makes it worse, but not by a lot. The problem seems to exist independent of scaling. As noted, the higher the resolution, the more LibreOffice hits the CPU when scrolling and the laggier it gets.

Not sure why this is happening. Microsoft Word only uses about 3% CPU when scrolling through a large document and isn't laggy at all. Very smooth.

I thought maybe it was a GTK thing, but it's not since it still happens on KDE Neon.
Comment 1 Stéphane Guillou (stragu) 2023-10-19 18:38:01 UTC
What is the first version you expérience the issue in?
Do you use Wayland?
Comment 2 M. Knepper 2023-10-20 06:06:02 UTC
The issue was reproducible in both Wayland and X, though it is worse on Wayland. 

The first version I noticed the issue on was 7.4 BUT I had never had a 4k monitor before then. So, as soon as I got a 4k monitor, I noticed the issue immediately. Who knows how long this is has been going on, if it has existed before this at all.

Were you able to reproduce my findings?

I think someone else should use LibreOffice 7.6 and 7.5 at 4k on some Linux distro with GTK (Fedora for example) or Qt (KDE Neon for example) and watch the CPU core usage and lag. I think I'm the only testing for this right now.

To test on Xorg, I ran i3 on Debian 12. As noted, it wasn't as severe, but it was still there.
Comment 3 M. Knepper 2023-10-20 06:41:53 UTC
Here is a video demonstrating the high CPU usage when scrolling at a resolution of 4k on Fedora. LO version is 7.6 (tested it on both 7.5 and 7.6, same result).

This particular video was recorded on Fedora 38 and is the 13700k machine with the 7900 XT and 32gb of DDR5 RAM.

For the sake of office comparison, MS Word only uses about 4 - 5% scrolling the same document size in both .ODT and .DOCX.

Video: https://youtu.be/kyI-rkd_hf4
Comment 4 M. Knepper 2023-10-20 06:43:41 UTC
Would like to add that this issue exists no matter if the display is being recorded or not. It's not from OBS. It's actually the first time I've recorded my desktop to document this.

But yeah, regardless of recording or not, same issue. Note other applications don't really exhibit this behavior.
Comment 5 M. Knepper 2023-10-24 16:05:25 UTC
Came here to add that I tried to replicate this on Windows 11 Pro and it does NOT occur. CPU usage is around 4% - 5% on Windows 11 Pro maximum and there are no problems scrolling. 

Specs are 13700k, 7900 XT, 32GB DDR5 7200mhz RAM, and Windows 11 Pro with a display resolution of 3480x2160 (4k).

This seems to be a Gnome/KDE specific issue at 4k on Linux.
Comment 6 Stéphane Guillou (stragu) 2023-10-24 18:55:38 UTC
Thank you for the thorough testing, much appreciated.
I think you are seeing the same as in bug 154602. Would you agree?

What would be very helpful: a bibisection of the issue to find out exactly when the issue started, if you are familiar with it, or if you are keen to spend some time in learning the process.
It is described on here: https://wiki.documentfoundation.org/QA/Bibisect
First thing to figure out is in which version the performance has significantly degraded. If the difference is noticeable enough, you will be able to do a bibisect.
Comment 7 dhina 2024-01-30 16:23:27 UTC Comment hidden (off-topic)
Comment 8 dhina 2024-01-30 16:43:54 UTC Comment hidden (off-topic)
Comment 9 Stéphane Guillou (stragu) 2024-03-12 04:55:09 UTC
OK let's go with duplicate of bug 154602.
Marked the macOS comments as "off-topic" as its a very different issue.

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