Bug Hunting Session
Bug 124098 - LibreCalc6.2: Opening a Calc with some formulas: It writes "adapt Row Height" which is taking ages to load!
Summary: LibreCalc6.2: Opening a Calc with some formulas: It writes "adapt Row Height"...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected)
Hardware: x86 (IA32) All
: medium normal
Assignee: Not Assigned
Keywords: bibisected, bisected, perf, regression
: 125499 (view as bug list)
Depends on:
Blocks: row-height-regressions
  Show dependency treegraph
Reported: 2019-03-15 13:03 UTC by elias estatistics
Modified: 2019-05-27 11:42 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:

OPs example file attached here to BZ (1.94 MB, application/vnd.oasis.opendocument.spreadsheet)
2019-03-15 14:24 UTC, V Stuart Foote

Note You need to log in before you can comment on or make changes to this bug.
Description elias estatistics 2019-03-15 13:03:44 UTC
LibreCalc: Opening a Calc with some formulas: It writes "adapt Row Height" which is taking ages to load!

See Kazam video and the Calc sheet itself. 

Note: this was opened very quickly in previous Libre Calc

Build ID: libreoffice-
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: el-GR (el_GR.UTF-8); UI-Language: en-US
Calc: threaded

Steps to Reproduce:
1.open the calc sheet in atatchment in Libre Calc6.2

Actual Results:
Very slow to open a calc sheet with formulas

Expected Results:
Quick ope of the calc file. 

Reproducible: Always

User Profile Reset: No

Additional Info:

Build ID: libreoffice-
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: el-GR (el_GR.UTF-8); UI-Language: en-US
Calc: threaded
Comment 1 elias estatistics 2019-03-15 13:05:58 UTC
Kazam Video of the process: https://upload.cat/9d2c64fe8efe70e0 
the Calc sheet itself: http://www.filedropper.com/a2means
Comment 2 V Stuart Foote 2019-03-15 14:24:21 UTC
Created attachment 149998 [details]
OPs example file attached here to BZ

Processing this large sheet on Windows is no faster, also gets held up with "adapt row height" processing.

Noticeable difference in handling between recent master/6.3.0alpha0+ and the release build

Version: (x64)
Build ID: 13a260f59e421f3e67845f8f2eb22b8f0f8fcaf0
CPU threads: 4; OS: Windows 10.0; UI render: GL; VCL: win; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2019-03-11_02:46:09
Locale: en-US (en_US); UI-Language: en-US
Calc: threaded

Version: (x64)
Build ID: fcd633fb1bf21b0a99c9acb3ad6e526437947b01
CPU threads: 4; OS: Windows 10.0; UI render: GL; VCL: win; 
Locale: en-US (en_US); UI-Language: en-US
Calc: threaded
Comment 3 V Stuart Foote 2019-03-15 14:33:32 UTC
better in master, but still issue. On same system with opened without "adopt row height" processing.

Version: (x64)
Build ID: 6b8ed514a9f8b44d37a1b96673cbbdd077e24059
CPU Threads: 4; OS Version: Windows 6.19; UI Render: default; Layout Engine: new; 
Locale: en-US (en_US); Calc: group
Comment 4 elias estatistics 2019-03-15 17:57:15 UTC
Here, Kazam video from opening the same file in Libre Office6.1.5.2

It takes less than some seconds 16  seconds vs 93seconds! ! Huge difference!  

video: https://ufile.io/rsb0j


Build ID: 1:6.1.5~rc2-0ubuntu0.18.04.1~lo3
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: x11; 
Locale: el-GR (el_GR.UTF-8); Calc: group threaded
Comment 5 Oliver Brinzing 2019-03-16 12:46:36 UTC
i checked with my notebook (Win10Pro x64, Core-i5-3320M 2,6GHZ,8GB, 256GB SSD) and settings:
- OpenGL/OpenCL:             disabled 
- Recalculation on File Load [Always recalculate]
- CPU threading settings:    disabled

LO ~40s
LO ~40s
LO ~65s
LO ~65s
Comment 6 V Stuart Foote 2019-03-16 16:16:27 UTC
So, if I force sheet to not update row heights--it loads immediately after calculating formula values.

A work around, but done by:

1. opening sheet

2. cursor focus into a cell with default row height (I used the first cell under the Indexing tables column)

3. select All cells

4. apply format from main menu Format -> Rows -> Height (the value shows 0.21 ")

5. save to a new ODS file

Open the newly saved version.  Seems the SC doc shell then does not call the SetOptimalHeight() or SetOptimalHeightOnly(), and so the document opens to screen with no delay after "calculating" of cell formulas completes. Speed is restored, but lose "optimal" font resize to fit results.
Comment 7 Kevin Suo 2019-05-01 09:48:16 UTC
bibisected using the bibisect-linux-64-6.2 repo:

5d007cfc8733799cf0535eac3e482eb8cae4b908 is the first bad commit
commit 5d007cfc8733799cf0535eac3e482eb8cae4b908
Author: Jenkins Build User <tdf@pollux.tdf>
Date:   Fri Jun 8 00:50:11 2018 +0200

    source sha:1e55a47e89a9d9d6cf9cb3993484022aaf2c097b

author Vasily Melenchuk <Vasily.Melenchuk@cib.de> 2018-04-06 20:19:10 +0300
committer Thorsten Behrens <Thorsten.Behrens@CIB.de> 2018-06-08 00:47:06 +0200
commit 1e55a47e89a9d9d6cf9cb3993484022aaf2c097b
tdf#62268: allow row height recalculation on document load
During document load rows with style:use-optimal-row-height="true" should recalculate it's height.

Adding Vasily Melenchuk to CC, would you please take a look.

git bisect log
# bad: [8b2cf76950e32ea46ff293ce75177841ad920e38] source sha:1149d20ce9f8682b58f98d3fa3bf289fc5974087
# good: [f741463dfe1900d3acf87b538c0c043e42bc523d] source sha:3a801799536e6870f2fb111b1cc00b9575a35a39
git bisect start 'master' 'oldest'
# bad: [f2a6a57cb2d0fbe45c9cfafdcf33a816c6ced63f] source sha:da8617d69a7b27a3eeb3f26e207ddf1b4de3eeb3
git bisect bad f2a6a57cb2d0fbe45c9cfafdcf33a816c6ced63f
# bad: [78b09b863133636196066d09bd1098bfd320b0e5] source sha:064c86b817c5d122af13f1bde26b51a992bf1fd9
git bisect bad 78b09b863133636196066d09bd1098bfd320b0e5
# bad: [350471d334577c65ef95c1ea1799eb8e83b340bc] source sha:2c85607101e2e04e870e3b87362f39f9a9148e6c
git bisect bad 350471d334577c65ef95c1ea1799eb8e83b340bc
# good: [6ba40cbc247af171132dc96e7e110c3b73c1e32a] source sha:18a8cac57d5450fef9111fa356839f07c7593ad0
git bisect good 6ba40cbc247af171132dc96e7e110c3b73c1e32a
# bad: [458d44d3be1e40259a480a7bbd2acce49d2df3f9] source sha:ba8c14f488a0bf9f1b10b5f1a24a367b8b98caf6
git bisect bad 458d44d3be1e40259a480a7bbd2acce49d2df3f9
# bad: [e5b96fbf312c88038a5109cd5a2cc1f7e931fed4] source sha:6c41b664cca6d6985b6f619f83cd103206c5a109
git bisect bad e5b96fbf312c88038a5109cd5a2cc1f7e931fed4
# bad: [12c296faec160c1166ae71e610cdb8778f3ec4af] source sha:8fef261588c40b8bd85395650afbaf0c9dbdac72
git bisect bad 12c296faec160c1166ae71e610cdb8778f3ec4af
# good: [45ee446cead7f889e05cc3f73738285faa78fb56] source sha:6b8915816242215208e1bb18cfbf01ae85619c46
git bisect good 45ee446cead7f889e05cc3f73738285faa78fb56
# good: [13760daeb59ff9bd2e4ecc973e108fea7a418b55] source sha:fccc7aebb5285e36530b14001e37b33b586365f9
git bisect good 13760daeb59ff9bd2e4ecc973e108fea7a418b55
# bad: [3bdbc761ffeaf9fbd913659c0499568e123d1ed2] source sha:f81714d8e70569506bd10cffc9dc6c18d7c6966f
git bisect bad 3bdbc761ffeaf9fbd913659c0499568e123d1ed2
# bad: [5d007cfc8733799cf0535eac3e482eb8cae4b908] source sha:1e55a47e89a9d9d6cf9cb3993484022aaf2c097b
git bisect bad 5d007cfc8733799cf0535eac3e482eb8cae4b908
# good: [a3266d604bbc628c822dd1dde60bde3004fbd9fd] source sha:b9dde4a74cba5a771cbc85880d518f6717d19216
git bisect good a3266d604bbc628c822dd1dde60bde3004fbd9fd
# good: [2fee85293f3c389834856f15f96e86ff537cee82] source sha:2a7f74900fb646235b74d4c9bd4690e44edc3ed4
git bisect good 2fee85293f3c389834856f15f96e86ff537cee82
# first bad commit: [5d007cfc8733799cf0535eac3e482eb8cae4b908] source sha:1e55a47e89a9d9d6cf9cb3993484022aaf2c097b

with a dbgutil build on master today, when open this file I get the following warning in terminal:
warn:sc:9128:9128:sc/source/filter/orcus/orcusfiltersimpl.cxx:149: Unable to load styles from xml file! failed to load
Comment 8 V Stuart Foote 2019-05-01 14:18:44 UTC
So does fix for bug 62268 need revisit? 

Seems if all rows with cells are assigned the "style:use-optimal-row-height='true'" we're doing the correct thing of parsing each row before rendering.

Isn't issue then that all rows of a close to empty sheet receive that style as default? It sets them to default, but parses each for cell content--expensive.

Simple fix might be to change default row style to "style:use-optimal-row-height='false'"--and only explicitly set it for rows with cell content?
Comment 9 Xisco Faulí 2019-05-27 11:42:45 UTC
*** Bug 125499 has been marked as a duplicate of this bug. ***