Bug 120727 - Excessive CPU usage under normal use (typing)
Summary: Excessive CPU usage under normal use (typing)
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.1.2.1 release
Hardware: All Mac OS X (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-20 10:04 UTC by laurens
Modified: 2019-05-18 06:15 UTC (History)
1 user (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 Praas 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)