Bug 114653 - using more than x custom properties in templates causes high CPU usage
Summary: using more than x custom properties in templates causes high CPU usage
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.4.3.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisectRequest, regression
Depends on:
Blocks: File-Properties
  Show dependency treegraph
 
Reported: 2017-12-22 14:08 UTC by Freddy
Modified: 2020-05-03 14:26 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
document template with a bunch of custom properties (7.76 KB, application/vnd.oasis.opendocument.text-template)
2017-12-23 14:10 UTC, Freddy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Freddy 2017-12-22 14:08:20 UTC
When defining custom properties for a document the CPU usage increases and the program freezes for a while when the number of properties increases (linear), starting from about 10 properties. This is easily reproduced by adding a lot of custom properties.

Tried version 6.0.0.0.beta2 as well. It happens on that version as well but is much less noticable (no freezes). Version 5.3.7 is (luckily) not affected.
Comment 1 Jean-Baptiste Faure 2017-12-23 11:00:27 UTC
Not sure how to reproduce and when the problem occurs.
Please, provide a test document and a clear and detailed step by step scenario to reproduce the problem.

Set status to NEEDINFO, please set it back to UNCONFIRMED once requested
informations are provided.

Best regards. JBF
Comment 2 Freddy 2017-12-23 14:08:41 UTC
> This is easily reproduced by adding a lot of custom properties.
Figured this was clear enough, however I created a document template (New Document, Properties, Custom Properties, Add property a bunch of times). You can open the template, go to properties and start editing the custom properties. There are 'only' 12 custom properties in this file you should only see short CPU spikes (and very short UI freezes) but adding a few more properties yourself should give you an idea of the issue.
Comment 3 Freddy 2017-12-23 14:10:04 UTC
Created attachment 138608 [details]
document template with a bunch of custom properties

Adding a few more custom properties will give you longer cpu spikes and ui freezes.
Comment 4 Jean-Baptiste Faure 2017-12-23 16:23:23 UTC
Ok, thank you for your answer.
Reproducible for me with LO 5.4.3 from Ubuntu PPA but not with LO 6.0.0.1.0+ 
Setting status to NEW and adding keyword regression because you wrote it does not happen in 5.3.7.

KO:
Version: 5.4.3.2
Build ID: 1:5.4.3~rc2-0ubuntu0.16.04.1~lo1
Threads CPU : 4; OS : Linux 4.4; UI Render : GL; VCL : gtk3; 
Locale : fr-FR (fr_FR.UTF-8); Calc: single

OK:
Version: 6.0.0.1.0+
Build ID: e16ef4a7d2f56a22dc05f8d05cf27d828d9d231b
Threads CPU : 4; OS : Linux 4.4; UI Render : GL; VCL: gtk3; 
Ubuntu_16.04_x86-64
Locale : fr-FR (fr_FR.UTF-8); Calc: threaded

Best regards. JBF
Comment 5 Xisco Faulí 2018-01-17 12:51:47 UTC
(In reply to Jean-Baptiste Faure from comment #4)
> Ok, thank you for your answer.
> Reproducible for me with LO 5.4.3 from Ubuntu PPA but not with LO 6.0.0.1.0+ 
> Setting status to NEW and adding keyword regression because you wrote it
> does not happen in 5.3.7.
> 
> KO:
> Version: 5.4.3.2
> Build ID: 1:5.4.3~rc2-0ubuntu0.16.04.1~lo1
> Threads CPU : 4; OS : Linux 4.4; UI Render : GL; VCL : gtk3; 
> Locale : fr-FR (fr_FR.UTF-8); Calc: single
> 
> OK:
> Version: 6.0.0.1.0+
> Build ID: e16ef4a7d2f56a22dc05f8d05cf27d828d9d231b
> Threads CPU : 4; OS : Linux 4.4; UI Render : GL; VCL: gtk3; 
> Ubuntu_16.04_x86-64
> Locale : fr-FR (fr_FR.UTF-8); Calc: threaded
> 
> Best regards. JBF

if it's ok in 6.0.0.1.0+ then we can close it as RESOLVED WORKSFORME.
@Freddy, Is the problem still reproducible in 5.4.4.2 ?
Comment 6 Freddy 2018-01-17 15:43:48 UTC
> @Freddy, Is the problem still reproducible in 5.4.4.2 ?

Yes, have not seen any improvement yet. And as said in the first post, version 6.0.0.2.0+ has the problem as well, it is less noticable however (shorter cpu spikes).
Comment 7 Freddy 2018-01-26 14:40:05 UTC
For fedora there is a new 5.4 version available that contains a patch that appears to solve the issue:

https://bugzilla.redhat.com/show_bug.cgi?id=1532323

One comment in there:"master doesn't suffer from the problem, so backporting commit that fixed it"

I could not quite work out what patch they are referring to, but it seems to have been fixed in 'master'?
Comment 8 Caolán McNamara 2018-01-26 15:52:43 UTC
The patch backported to 5-4 is the fix of http://cgit.freedesktop.org/libreoffice/core/commit/?id=272a96da03522a82db4185e7858d05375f3ea95e for bug 100922
Comment 9 Aron Budea 2020-05-03 06:28:00 UTC
(In reply to Freddy from comment #0)
> Tried version 6.0.0.0.beta2 as well. It happens on that version as well but
> is much less noticable (no freezes). Version 5.3.7 is (luckily) not affected.
The commit Caolán mentioned was already part of 6.0 beta2. Not sure if this bug could be considered fixed or not in that state, however there've been several versions since then, please retest with a current release.
Comment 10 Freddy 2020-05-03 14:26:05 UTC
Apologies, kind of forgot about this one. I am not able to reproduce on version 6.4.3.2 (Flatpak). So let's close this.