Bug 123417 - File with lots of comments opens slower compared to LibO 4.4.7.2
Summary: File with lots of comments opens slower compared to LibO 4.4.7.2
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.3.0.0.alpha0+
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, haveBacktrace, perf, regression
Depends on:
Blocks: Calc-Comments File-Opening Regressions-HarfBuzz
  Show dependency treegraph
 
Reported: 2019-02-12 19:56 UTC by Telesto
Modified: 2023-08-22 18:56 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Callgrind output from master (6.78 MB, application/x-xz)
2019-02-18 12:10 UTC, Buovjaga
Details
Flamegraph (2.79 MB, image/svg+xml)
2019-08-11 10:05 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2019-02-12 19:56:42 UTC
Description:
File with lots of comments opens slower compared to 4.4.7.2

Steps to Reproduce:
1. Open attachment 144526 [details] (bug 119075) and monitor time to open

Actual Results:
25 seconds

Expected Results:
15 seconds with 4.4.7.2


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 6.3.0.0.alpha0+
Build ID: 0b21f6556b6fff76290d1095089da89532365215
CPU threads: 4; OS: Windows 6.3; UI render: default; VCL: win; 
Locale: nl-NL (nl_NL); UI-Language: en-US
Calc: CL
Comment 1 Telesto 2019-02-12 20:31:03 UTC
Slightly better with non-debug build (20 seconds)
Version: 6.3.0.0.alpha0+
Build ID: e0745a11597e5d57eb8001a295314e86810a6027
CPU threads: 4; OS: Windows 6.3; UI render: default; VCL: win; 
TinderBox: Win-x86@42, Branch:master, Time: 2019-02-12_04:16:22
Locale: nl-NL (nl_NL); UI-Language: en-US
Calc: CL
Comment 2 Durgapriyanka 2019-02-14 18:01:06 UTC
Thank you for reporting the bug. I can confirm the bug is present. It takes around 50 sec to open the file.

Version: 6.3.0.0.alpha0+
Build ID: b6b28931435e44aca92b8c0e1659f701e3ed1a87
CPU threads: 2; OS: Windows 6.1; UI render: default; VCL: win; 
TinderBox: Win-x86@42, Branch:master, Time: 2019-01-30_06:57:04
Locale: en-US (en_US); UI-Language: en-US
Calc: threaded
Comment 3 Buovjaga 2019-02-17 20:18:27 UTC
I got this result with win32-5.3: https://gerrit.libreoffice.org/plugins/gitiles/core/+/8f2dd1df1d6cc94ebbc1149de72bc6d6dffa6533%5E!/
Revert "Revert "Enable the new text layout engine by default""

It sounds plausible. As always, it is a bit hazy with these ones as sometimes there are multiple different times to open in the repo commits. I encourage others to bibisect as well. With perf issues, you should avoid doing any background processing while the measured task is going on.
Comment 4 Telesto 2019-02-18 08:47:41 UTC
Seems sensible.. I changed the TextLayoutEngine mode to OLD and it's fine:
Tools -> Options -> Advanced: Expert Configuration search for "TextLayoutEngine" and edit to change "new|old" (only for LibO 5.3 range)

It's maybe possible to narrow it down.. but would mean forcing TextLayoutEngine on when it's off.. there was some command for it.. 

The Advanced: Expert Configuration is only added at the end, not really helpful..
Comment 5 Buovjaga 2019-02-18 12:10:25 UTC
Created attachment 149366 [details]
Callgrind output from master

On Windows you can use
set SAL_USE_COMMON_LAYOUT=1
to activate it
or
set SAL_USE_COMMON_LAYOUT=
to remove the env variable.

Arch Linux 64-bit
Version: 6.3.0.0.alpha0+
Build ID: e77beebb0d839f5dc0d4f9c4fd7cc9b7ccfd0175
CPU threads: 8; OS: Linux 4.20; UI render: default; VCL: gtk3; 
Locale: fi-FI (fi_FI.UTF-8); UI-Language: en-US
Calc: threaded
Built on 16 February 2019
Comment 6 b. 2019-05-30 18:55:24 UTC
i doubt anything around comments is 'fine', 

you have about 6k long comments in the sheet, up from 200 you get measureable cpu load, up from 10k drastic delays and freezes - depends on system and version of course - , 

see #76324 and plenty subsequent reports reg. 'calc' and 'slow', there is! big performance impact by too many comments, it looks to be very difficult, otherwise someone would have fixed it in the past 5 years ...
Comment 7 Julien Nabet 2019-08-11 10:05:31 UTC
Created attachment 153291 [details]
Flamegraph
Comment 8 QA Administrators 2021-08-11 03:58:04 UTC Comment hidden (obsolete)
Comment 9 Telesto 2021-08-11 08:37:01 UTC
Still present
Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 36efb384a66b6dd645e0ae80fd7df68370a9dc8b
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL
Comment 10 Telesto 2021-08-11 08:38:30 UTC
@Noel,
You might be interested in this one, based on you're history of optimizations...
Comment 11 QA Administrators 2023-08-12 03:05:34 UTC Comment hidden (obsolete)
Comment 12 Noel Grandin 2023-08-22 09:53:42 UTC
On current master, it loads in 6.5 seconds on my machine. Assuming that my machine is very very fast (which it is), I am guessing it will load at closer to 12 or 15 seconds on a "normal" machine, which means this is fixed.