Bug Hunting Session
Bug 119992 - Lots of CPU time needed for changing table column width
Summary: Lots of CPU time needed for changing table column width
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.2.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: target:6.2.0
Keywords: bibisected, bisected, perf, regression
: 120442 (view as bug list)
Depends on:
Blocks: Writer-Tables
  Show dependency treegraph
 
Reported: 2018-09-19 18:45 UTC by Telesto
Modified: 2018-10-17 16:28 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file (50.21 KB, application/vnd.oasis.opendocument.text)
2018-09-20 09:03 UTC, Telesto
Details
Measure patch. (1.09 KB, patch)
2018-10-12 16:00 UTC, Miklos Vajna
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2018-09-19 18:45:17 UTC
Description:
Lots of CPU time needed reducing for reducing the column width

Steps to Reproduce:
1. Open attachment 144815 [details]
2. Change the column width to 15

Actual Results:
Time taking to process: 1:30 

Expected Results:
Around 20 seconds or less?


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 6.2.0.0.alpha0+
Build ID: 7d242f3bd7277236046f90d3f32b9792fd8ea97b
CPU threads: 4; OS: Windows 6.3; UI render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2018-09-18_23:43:19
Locale: nl-NL (nl_NL); Calc: CL
Comment 1 Telesto 2018-09-20 09:03:43 UTC Comment hidden (obsolete)
Comment 2 Telesto 2018-09-25 10:19:34 UTC
Two regressions:

Between
Version: 6.2.0.0.alpha0+
Build ID: 1aa37aa6bee19099b57555a6d839992b054aa405
CPU threads: 4; OS: Windows 6.3; UI render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2018-09-23_10:17:54
Locale: nl-NL (nl_NL); Calc: CL

and
Version: 6.1.0.0.beta2+
Build ID: 22c451df33b733440f24c1feb6380d31240d55e6
CPU threads: 4; OS: Windows 6.3; UI render: default; 
Locale: nl-NL (nl_NL); Calc: CL

38 seconds in LibO 6.1
1:30 in LibO6.2

---

Between
Versie: 4.1.0.4 
Build ID: 89ea49ddacd9aa532507cbf852f2bb22b1ace28

and
Versie 4.0.0.3 (Bouw-id: 7545bee9c2a0782548772a21bc84a9dcc583b89)

30 seconds 100% processing versus +/- 50% processing
Comment 3 Telesto 2018-09-25 10:32:40 UTC
Bisected to:

author	Miklos Vajna <vmiklos@collabora.co.uk>	2018-08-31 18:19:12 +0200
committer	Miklos Vajna <vmiklos@collabora.co.uk>	2018-09-03 09:13:32 +0200
commit	aeff83240c88435d11590f5e9c6fe9927a508c6a (patch)
tree	a3b918a7d3164ee428a4df39df7118a87618dfd9
parent	08b5048198d59441cb8033ed14cd17e68c943004 (diff)
sw: save more vcl layout calls in SwFntObj
This builds on top of commit 436b829f5b904d76039db0818cff5dedf1ae89f1
(sw: save one vcl layout call in SwFntObj::DrawText(), 2018-08-16), but
now layouts are shared not only inside SwFntObj::DrawText(), but also
between SwFntObj::GetTextSize() and SwFntObj::DrawText().

To get there, create an SwFntObj cache member that stores already
calculated vcl layouts. SwFntObj already derives from SwCacheObj, so no
need to explicitly expire this cache member.

Total number of GenericSalLayout::LayoutText() invocations go down from
8 to 5 with this when pressing a key in Writer.

https://cgit.freedesktop.org/libreoffice/core/commit/?id=aeff83240c88435d11590f5e9c6fe9927a508c6a
Comment 4 Telesto 2018-09-25 10:33:22 UTC
A conformation would be nice :-)
Comment 5 Buovjaga 2018-09-26 18:45:31 UTC
(In reply to Telesto from comment #4)
> A conformation would be nice :-)

I believe I can confirm.

Adding Cc: to Miklos Vajna

Arch Linux 64-bit
Version: 6.2.0.0.alpha0+
Build ID: 88e26267844ac96f39d341ef05bd1536f210af74
CPU threads: 8; OS: Linux 4.18; UI render: default; VCL: gtk3_kde5; 
Locale: fi-FI (fi_FI.UTF-8); Calc: threaded
Built on 25 September 2018
Comment 6 Miklos Vajna 2018-10-09 13:19:58 UTC
> Change the column width to 15

Could you be more precise, please? The document has 738 pages and it's of a single column, so what do you do exactly? Thanks.
Comment 7 Buovjaga 2018-10-09 13:53:08 UTC
(In reply to Miklos Vajna from comment #6)
> > Change the column width to 15
> 
> Could you be more precise, please? The document has 738 pages and it's of a
> single column, so what do you do exactly? Thanks.

Table column was meant. Right-click table - Columns - input 15 to field 1. "Reducing" is the wrong word here.
Comment 8 Miklos Vajna 2018-10-09 14:14:17 UTC
Oh, I missed that the description talks about one bugdoc and the only attachment to this bug is an other bugdoc. That confused me. :-)
Comment 9 Buovjaga 2018-10-11 14:05:17 UTC
*** Bug 120442 has been marked as a duplicate of this bug. ***
Comment 10 Miklos Vajna 2018-10-12 16:00:08 UTC
Created attachment 145657 [details]
Measure patch.

Attaching a patch that allows a reliable way to measure the time spent between closing the table properties the dialog and layout reaching idle state.
Comment 11 Commit Notification 2018-10-12 18:39:03 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c7b83934fcf4120c1a4cba8e1eaf9c7aef9edc82

tdf#119992 sw: compare sub-strings in SwTextGlyphsKey comparison

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Xisco Faulí 2018-10-17 16:28:32 UTC
Verified in

Version: 6.2.0.0.alpha0+
Build ID: 647fc41763d1310479d59262734caa296f6e558d
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: en-US (ca_ES.UTF-8); Calc: threaded

it takes ~20 seconds now.

@Miklos, thanks for fixing this!!