Bug 120727 - Excessive CPU usage under normal use (typing) see comment 33
Summary: Excessive CPU usage under normal use (typing) see comment 33
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.1.2.1 release
Hardware: All macOS (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: perf
Depends on:
Blocks: Anchor-and-Text-Wrap MacOS-Performance
  Show dependency treegraph
 
Reported: 2018-10-20 10:04 UTC by laurens
Modified: 2023-02-25 08:45 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
Example of problem document (22.57 KB, application/vnd.oasis.opendocument.text)
2018-10-20 10:04 UTC, laurens
Details
Example file (904.15 KB, application/vnd.oasis.opendocument.text)
2019-03-23 12:16 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description laurens 2018-10-20 10:04:20 UTC
Created attachment 145852 [details]
Example of problem document

Unfortunately past few version of LO have been CPU hogs in normal usage (typing), causing significant lag and detracting from the use experience (as if typing via a remote desktop connection)

Have tried resetting the profile, no change.

I don't remember when this has changed - but it has been a issue for the past few months (at least since 6.0 - I normally update regularly)

When I type in this document with a graphics object on the page, 
the CPU usage is 50% on a 2.6GHz 8th Gen Core i7.

LO 6.1.2.1 on macOS 10.13.6
Open CL is not used. Auto spellcheck is off. 

Expected behaviour:
CPU usage low (<10%)
"snappy" UX whilst typing

Actual behaviour:
CPU usage 50% of a 2.6GHz core
typing has (tens of ms?) lag
Comment 1 Alex Thurgood 2018-10-24 06:37:49 UTC
Unfortunately, I can't reproduce this on my system with your document:

Version: 6.1.2.1
Build ID: 65905a128db06ba48db947242809d14d3f9a93fe
Threads CPU : 8; OS : Mac OS X 10.13.6; UI Render : par défaut; 
Locale : fr-FR (fr_FR.UTF-8); Calc: group threaded
Comment 2 Alex Thurgood 2018-10-24 06:39:24 UTC
Tested on:
MacBook Pro (Retina, 15 inch, end 2013)
2,6 GHz Intel Core i7
16 Go 1600 MHz DDR3
Comment 3 Alex Thurgood 2018-10-24 06:41:53 UTC
@laurens : how many fonts are installed on your system ?

The test document shows a style at the bottom in the status bar that is called "First convert 1" - has this document been converted from a previous other format?
Comment 4 laurens 2018-10-24 06:45:37 UTC
thanks, Fonts: 242 (Font Book.app)
Our company has used LO since StarOffice days - it is possible that this document has its origin from back then.

I don't think that it has been through docx, but cannot be sure.

Would like to find a fix that does not require a new template though - as we cannot go through 1000s of existing documents to fix this.
Comment 5 laurens 2018-10-24 06:56:56 UTC
Just deleted my /4 profile and re-opened this document
CPU usage typing: 50%
Open LO in "low resolution" CPU usage while typing is ca. 30-40% (bit less, still a lot)

I.e. completely fresh profile does not change anything

2018 MBP is running at retina resolution, internal GPU.
Comment 6 laurens 2018-11-06 07:50:43 UTC
Updated macOS to Mojave 10.14.1: same problem. 
reverted to LO 6.0.6.2: same problem


Editing work documents with graphics in them is a very bad experience due to this CPU usage.

241 fonts - all validated, no duplicates.

Anti-aliasing off
OpenGL off
OpenCL options: all off
Comment 7 laurens 2018-11-30 07:46:31 UTC
(In reply to Alex Thurgood from comment #3)
> @laurens : how many fonts are installed on your system ?
> 
> The test document shows a style at the bottom in the status bar that is
> called "First convert 1" - has this document been converted from a previous
> other format?

I also happens with "fresh" documents

I have noticed this with multiple documents on multiple retina mac systems:
If I change the object Anchor from "to paragraph" -> ""as character" 
the CPU usage whilst typing (with the object on the page) DROPS from 50% to 8-15%!!

Scrolling through my documents is also much smoother when changing all frames from Anchor "to paragraph" -> "as character"

I hope that this helps with sorting out this bug - I think that more people have this issue (https://www.reddit.com/r/libreoffice/comments/94n2e3/libreoffice_so_slow_its_almost_unusable_on_mac/)

1. Can someone understand why / fix?
2. Add default for insertion of new frames to be Anchor-> As character.
Comment 8 Xisco Faulí 2018-12-04 22:49:30 UTC
Might be related to bug 121778...
Comment 9 Timur 2018-12-27 12:29:47 UTC
To confirm if it's Bug 120727, please download new 6.1.4 and test.
Comment 10 Timur 2018-12-27 12:29:58 UTC
Bug 121778
Comment 11 laurens 2018-12-27 13:00:10 UTC
Version: 6.1.4.2
Build ID: 9d0f32d1f0b509096fd65e0d4bec26ddd1938fd3
CPU threads: 12; OS: Mac OS X 10.14.2; UI render: default; 
Locale: nb-NO (en_NO.UTF-8); Calc: threaded

No change on editting my attachment above the figure on page 1 - still 60-90% CPU when just typing(!) on a Hexcore 8th Gen i5 (!). 

Note: Changing anchor of the figure to "As Character" has a HUGE reduction on CPU usage whilst typing (from 60-90% to 10-20% CPU usage) (this occurs on 6.0.5 to 6.1.4.2)

If graphics are on the page they must be set to Anchor->"As character", especially on a retina Macbook - otherwise LO performance is terrible and uses >50+% CPU with significant lag whilst just typing text (almost unusable).
Comment 12 Xisco Faulí 2019-01-17 11:59:25 UTC
Hello Laurens,
Please, redownload LibreOffice from https://www.libreoffice.org/download/download/ and reinstall it. We had to rebuild it with xcode 9 to fix hang/crash problems with Mojave

*** This bug has been marked as a duplicate of bug 121778 ***
Comment 13 laurens 2019-01-17 13:01:23 UTC
Version: 6.1.4.2
Build ID: 9d0f32d1f0b509096fd65e0d4bec26ddd1938fd3
CPU threads: 12; OS: Mac OS X 10.14.2; UI render: default; 
Locale: nb-NO (en_NO.UTF-8); Calc: group threaded

No difference still laggy whilst typing on a 2018 MacBook Pro (6-core) - improves a lot ONLY when graphics object anchor is changed to "As Character"
Comment 14 Xisco Faulí 2019-01-17 14:13:13 UTC
(In reply to laurens from comment #13)
> Version: 6.1.4.2
> Build ID: 9d0f32d1f0b509096fd65e0d4bec26ddd1938fd3
> CPU threads: 12; OS: Mac OS X 10.14.2; UI render: default; 
> Locale: nb-NO (en_NO.UTF-8); Calc: group threaded
> 
> No difference still laggy whilst typing on a 2018 MacBook Pro (6-core) -
> improves a lot ONLY when graphics object anchor is changed to "As Character"

Did you unstinstall it, download the new 6.1.4.2 and install it again ?
Comment 15 laurens 2019-01-17 14:19:31 UTC
Download today
Open DMG
copy over to Applications

(did not delete old one, but AFAIK that is not necessary for macOS programs)

Build ID was the same as the last time I tried (ends with d3)

ref: 2012-12-27 and 2019-01-17 posts.
Comment 16 Alex Thurgood 2019-01-17 16:52:04 UTC
Sorry, still no repro with test document and

Version: 6.1.3.2
Build ID: 86daf60bf00efa86ad547e59e09d6bb77c699acb
CPU threads: 4; OS: Mac OS X 10.14.2; UI render: default; 
Locale: fr-FR (fr_FR.UTF-8); Calc: group threaded
Comment 17 Alex Thurgood 2019-01-17 16:55:38 UTC
No repro either wiht

Version: 6.2.0.2 release candidate
Build ID: 2ce5217b30a543f7666022df50f0562f82be0cff
CPU threads: 4; OS: Mac OS X 10.14.2; UI render: default; VCL: osx; 
Locale: fr-FR (fr_FR.UTF-8); UI-Language: en-US
Calc: threaded
Comment 18 Alex Thurgood 2019-01-17 16:57:58 UTC
@Laurens : which, if any, lang packs do you have installed ?
Comment 19 laurens 2019-01-17 17:31:48 UTC
No language packs AFAIK (Default English - USA) Locale: Norwegian (though seems to make no difference). 

The only thing that reduces CPU usage whilst typing to <50% is change the Anchor type of the image in the test document to "As Character" from "To Paragraph"
Comment 20 Xisco Faulí 2019-02-07 20:07:27 UTC
Hi There,
is it still reproducible in LibreOffice 6.2 from https://www.libreoffice.org/download/libreoffice-fresh/ ?
Comment 21 Xisco Faulí 2019-02-07 20:13:20 UTC
Seems to be related to bug 118991
Comment 22 raroru 2019-02-21 21:31:18 UTC
Hello,

i had the same problem as laurens with older version of Libreoffice, i uninstalled and reinstall last version and same problem again:

even only scrolling a simple document with text (and with the example of laurens as well) is a nightmare: so slow.

Version: 6.2.0.3
Build ID: 98c6a8a1c6c7b144ce3cc729e34964b47ce25d62
CPU threads: 4; OS: Mac OS X 10.14.3; UI render: default; VCL: osx; 
Locale: fr-FR (en_FR.UTF-8); UI-Language: en-US
Calc: threaded

Computer:

  Model Name:	MacBook Pro
  Model Identifier:	MacBookPro13,1
  Processor Name:	Intel Core i5
  Processor Speed:	2 GHz
  Number of Processors:	1
  Total Number of Cores:	2
  L2 Cache (per Core):	256 KB
  L3 Cache:	4 MB
  Memory:	8 GB
  Boot ROM Version:	228.0.0.0.0
  SMC Version (system):	2.36f97




When scrolling, MAC OS activity monitor shows at least 60% use of CPU, up to more than 100% in a few seconds of scrolling.

Degrading to right click in libreoffice.app and"get info, low resolution" is better but still slow; and ugly.


Thanks for help!
Comment 23 laurens 2019-03-18 11:17:24 UTC
Still same problem with

Version: 6.2.1.2
Build ID: 7bcb35dc3024a62dea0caee87020152d1ee96e71
CPU threads: 12; OS: Mac OS X 10.14.3; UI render: default; VCL: osx; 
Locale: nb-NO (en_NO.UTF-8); UI-Language: en-US
Calc: threaded

as mentioned: changing anchor type of graphic objects that are visible
From Anchor:
To Paragraph 
to:
As Character 

changes CPU usage from 90% whilst typing (!!!) to 10% whilst typing
Comment 24 raroru 2019-03-22 09:36:50 UTC
Hello,

still same problem with new version of Libreoffice

Version: 6.2.2.1
Build ID: fcd633fb1bf21b0a99c9acb3ad6e526437947b01
CPU threads: 4; OS: Mac OS X 10.14.3; UI render: default; VCL: osx; 
Locale: fr-FR (en_FR.UTF-8); UI-Language: en-US
Calc: threaded


The problem is happening with Libreoffice Impress /  presentation as well.


Thanks
Comment 25 Dieter 2019-03-22 10:02:16 UTC
(In reply to raroru from comment #24)

> still same problem with new version of Libreoffice

=> So you can confirm the described problem? In this case you can change bug-status to NEW.
Comment 26 Telesto 2019-03-23 12:16:42 UTC
Created attachment 150226 [details]
Example file

I expect two underlying issues:
A. Holding a key above the drawing causes high CPU usage in Windows too (no lag).. made the document more complex. So I assume this is one out of many variants of meta bug 119334. 

B. The general performance issues on MacOS make things even worse (especially Retina screens). See for example bug 113104 or bug 103864
Comment 27 laurens 2019-03-24 11:15:59 UTC
Version: 6.2.2.2
Build ID: 2b840030fec2aae0fd2658d8d4f9548af4e3518d
CPU threads: 12; OS: Mac OS X 10.14.3; UI render: default; VCL: osx; 
Locale: nb-NO (en_NO.UTF-8); UI-Language: en-US
Calc: threaded

The http://bugs.documentfoundation.org/attachment.cgi?id=145852

attachment does show very poor performance on my 2018 MBP Core i7

It is almost unusable (type lag) when using the internal Intel GPU. 
When I connect to an external 1920x1200 screen the dGPU (AMD something) gets enabled automatically and then LO is usable, but obviously it should be possible to type a WYSIWYG document on a modern laptop with integrated GPU.
Comment 28 Xisco Faulí 2019-03-25 17:18:03 UTC
You can't confirm your own bugs. Moving it back to UNCONFIRMED until someone
else confirms it.
Comment 29 raroru 2019-03-25 22:27:14 UTC
Hello,

i confirm the bug, same problem than  laurens@norbit.no  with the document he links.

Laggy as hell, CPU going above 76percent


Version: 6.2.2.1
Build ID: fcd633fb1bf21b0a99c9acb3ad6e526437947b01
CPU threads: 4; OS: Mac OS X 10.14.3; UI render: default; VCL: osx; 
Locale: fr-FR (en_FR.UTF-8); UI-Language: en-US
Calc: threaded


computer:

Model Name:	MacBook Pro
  Model Identifier:	MacBookPro13,1
  Processor Name:	Intel Core i5
  Processor Speed:	2 GHz
  Number of Processors:	1
  Total Number of Cores:	2
  L2 Cache (per Core):	256 KB
  L3 Cache:	4 MB
  Memory:	8 GB
  Boot ROM Version:	228.0.0.0.0
  SMC Version (system):	2.36f97


software:
mac OS mojave
version 10.14.3 (18D109)


thanks
Comment 30 Yury Zhuravlev 2019-04-03 02:36:44 UTC
I can confirm it. 
My computer 
Model Name:	Mac Pro
  Model Identifier:	MacPro6,1
  Processor Name:	6-Core Intel Xeon E5
  Processor Speed:	3.5 GHz
  Number of Processors:	1
  Total Number of Cores:	6
  L2 Cache (per Core):	256 KB
  L3 Cache:	12 MB
  Memory:	32 GB

GPU:
Chipset Model:	AMD FirePro D500
  Type:	GPU
  Bus:	PCIe
  Slot:	Slot-1
  PCIe Lane Width:	x16
  VRAM (Dynamic, Max):	3072 MB
  Vendor:	AMD (0x1002)

My monitor's Dell2416UP (not a Retina) but I also have the second monitor with common FullHD resolution. 

Looks like this problem significant for AMD graphics cards. Also, I think for Calc documents situations much worse. 
Use LO on the Mac not possible I think.

Thanks.
Comment 31 David 2019-05-01 09:46:18 UTC
I can also confirm this problem on my iMac 2017, i5 7400, RP 555, MacOS 10.14.4 using LO 6.2.3.

I have freshly installed MacOS a week ago and used the latest build from LO's website. Even a simple LO calc document is pretty much unusable. Scrolling is stutter. Maneuvering inside the document is a pain.

Please fix.
Comment 32 David 2019-05-01 09:50:10 UTC
... also I notice that one of my CPU cores spikes to 100% usage when scrolling or virtually doing anything in any LO document. Be it calc or and odt.
Comment 33 laurens 2019-05-18 06:15:16 UTC
Hi - just tested on 6.1.6.3 - no change

The problem remains - scrolling & typing performance is very bad with the Intel GPU when there are embedded OLE objects that are not Anchored "As Character"

Version: 6.1.6.3
Build ID: 5896ab1714085361c45cf540f76f60673dd96a72
CPU threads: 12; OS: Mac OS X 10.14.5; UI render: default; 
Locale: nb-NO (en_NO.UTF-8); Calc: group threaded



Workarounds to improve scrolling / typing lag (I think the first one indicates the source of the problem - some kind of positioning calculation loop?)


* The only thing that reduces CPU usage whilst typing to <50% is change the Anchor type of the image in the test document to "As Character" from "To Paragraph"

* Changing the LibreOffice.app to "open in Low Resolution" (loose the screen sharpness)

* Changing to the dGPU (using 10W extra is a big problem on a laptop)
Comment 34 Ilya Zverev 2020-04-27 11:43:47 UTC
COnfirming on 6.4 under macOS 10.14.5. Both with GL disabled and enabled. Smooth Scrolling is off.

Version: 6.4.2.2
Build ID: 4e471d8c02c9c90f512f7f9ead8875b57fcb1ec3
CPU threads: 8; OS: Mac OS X 10.14.5; UI render: GL; VCL: osx; 
Locale: ru-RU (en_RU.UTF-8); UI-Language: en-US
Calc: threaded
Comment 35 info 2020-06-18 08:42:16 UTC
Problem remains in 7.0.0 beta1

This makes LO pretty much unusable on a recent mac laptop because of the typing delay (lag) when there are pictures in the document (and the CPU usage) 

It's like using a VT-100 terminal on a 300baud connection!
Can anyone else confirm?



Version: 7.0.0.0.beta1
Build ID: 94f789cbb33335b4a511c319542c7bdc31ff3b3c
CPU threads: 12; OS: Mac OS X 10.15.5; UI render: default; VCL: osx
Locale: nb-NO (en_NO.UTF-8); UI: en-US
Calc: threaded
Comment 36 laurens 2020-10-30 15:26:31 UTC
Remains a major problem in 

Version: 7.0.2.2
Build ID: 8349ace3c3162073abd90d81fd06dcfb6b36b994
CPU threads: 12; OS: Mac OS X 10.15.7; UI render: default; VCL: osx
Locale: nb-NO (en_NO.UTF-8); UI: en-US
Calc: threaded
Comment 37 Telesto 2021-10-04 18:05:22 UTC
Fine for me on Windows
Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: b60b6bfaafa1315e07108dba50f016975b619c59
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: en-US (nl_NL); UI: en-US
Calc: CL

This should improve with Skia being available on MacOS
Comment 38 Luboš Luňák 2021-11-18 14:04:41 UTC
Please try this with a developer build from https://dev-builds.libreoffice.org/daily/master/ [*]. Check with option Tools->Options->View->Use Skia for all rendering both enabled and disabled, and when enabled with both Force Skia software rendering enabled and disabled.

[*] Today's build may still have some rendering problems in dialogs, so tomorrow's should be better, but even today's should be usable for testing this bug.
Comment 39 steve 2021-11-19 15:05:21 UTC
Version: 7.3.0.0.alpha1+ / LibreOffice Community
Build ID: 11800469cc7b3a40c42410be93a12e5107db0efb
CPU threads: 8; OS: Mac OS X 10.16; UI render: Skia/Raster; VCL: osx
Locale: de-DE (en_DE.UTF-8); UI: en-US
Calc: threaded

Retested with "Example file" by Telesto.

✓ Use Skia for all rendering
    ✓ Force Skia software rendering
Typing: CPU ~40-50%
Scrolling: CPU ~100%
Note: typing in documented resulted in document recovery being triggered once. Deselecting Force Skia software rendering triggered another document recovery (not reproducible)


✓ Use Skia for all rendering
    x Force Skia software rendering
Typing: CPU ~25-34%
Scrolling: CPU ~19%


x Use Skia for all rendering
    x Force Skia software rendering
Typing: CPU ~50-65%
Scrolling: CPU ~100%

Think it is more than fair to assess there is progress using Skia. Can others test? What values are we looking for to call this fixed?
Comment 40 Telesto 2021-11-20 20:26:18 UTC
(In reply to steve from comment #39)
> Note: typing in documented resulted in document recovery being triggered
> once. Deselecting Force Skia software rendering triggered another document
> recovery (not reproducible)

Well for me it crashes while scrolling the document.. And having noticed view random crashes while fiddling with the icon settings.  

But running on Catalina & possible with code signing issues.. upgrading MacOS now & checking again
Comment 41 psidiumcode 2021-11-22 21:11:37 UTC
Version: 7.3.0.0.alpha1+ / LibreOffice Community
Build ID: 7b73163e6d8aca1b4a55547a4f337f36b9697b87
CPU threads: 12; OS: Mac OS X 10.15.7; UI render: default; VCL: osx
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: threaded

3,1 GHz 6-Core Intel Core i5

Made the same test as steve.
Using the "Example file" by Telesto.

✓ Use Skia for all rendering
    ✓ Force Skia software rendering
Typing: CPU ~20-30%
Scrolling: CPU ~60-100%
Note: It cashed once. 


✓ Use Skia for all rendering
    x Force Skia software rendering
Typing: CPU ~10-12%
Scrolling: CPU ~31-45%
Note: Manu buttons background has a green colour.


x Use Skia for all rendering
    x Force Skia software rendering
Typing: CPU ~19-21%
Scrolling: CPU ~98-100%
Comment 42 info 2023-02-25 08:40:30 UTC
Still a problem for me...

Laggy typing once I have some PNG images that are inserted into a document.
Activity Monitor shows that Libreoffice has high(30-40%) whilst typing.

This is on a MBP16 6-core laptop.

As I have noted before: changing the graphics to Anchor - As Character greatly improves performance - so though LO 6.x to 7.5 this remains a problem with (retina) Macbooks.

Would be great if other people could confirm...



Version: 7.5.0.3 (X86_64) / LibreOffice Community
Build ID: c21113d003cd3efa8c53188764377a8272d9d6de
CPU threads: 12; OS: Mac OS X 12.6.3; UI render: default; VCL: osx
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: threaded
Comment 43 info 2023-02-25 08:45:05 UTC
Changing to Skia seems to improve this quite a lot!

I guess that Skia rendering is the long term solution?


Version: 7.5.0.3 (X86_64) / LibreOffice Community
Build ID: c21113d003cd3efa8c53188764377a8272d9d6de
CPU threads: 12; OS: Mac OS X 12.6.3; UI render: Skia/Metal; VCL: osx
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: threaded