Bug 88109 - PERF: Calc autofill is very slow
Summary: PERF: Calc autofill is very slow
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.0.0 target:7.1.0 target:7.0.0.1
Keywords: perf
Depends on:
Blocks: AutoFill
  Show dependency treegraph
 
Reported: 2015-01-06 13:09 UTC by Muthu
Modified: 2020-06-09 11:33 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample file (2.39 MB, application/vnd.oasis.opendocument.spreadsheet)
2015-01-06 13:09 UTC, Muthu
Details
perf flamegraph (85.84 KB, application/x-bzip)
2019-12-30 17:41 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Muthu 2015-01-06 13:09:36 UTC
Created attachment 111848 [details]
Sample file

Calc's autofill is annoyingly slow even for very simple formulas.

Steps:
1. Open the attached ods file
2. In vell 'F3' there is a simple 'trim' function
3. Double click on the bottom right corner of the cell to autofill
4. Calc seems to take quite a lot of time to autofill the cells.
Comment 1 raal 2015-01-09 15:20:57 UTC
Calc 4.5 and 3.5 is +- the same time (slow, tens of seconds).
Comparing to excel where this operation takes 1 sec (slower VM on my machine ), so it's possible to make this instantly..

Marking as NEW.
Comment 2 Robinson Tryon (qubit) 2015-12-09 18:08:14 UTC Comment hidden (obsolete)
Comment 3 QA Administrators 2017-01-03 19:42:55 UTC Comment hidden (obsolete)
Comment 4 Xisco Faulí 2017-06-16 09:31:21 UTC
it takes 1 minute and 55 seconds in

Version: 5.5.0.0.alpha0+
Build ID: 6ab249ea6aecef5d3f35d624622a368061cad9c3
CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group
Comment 5 Xisco Faulí 2017-06-16 09:41:37 UTC
In

LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4

it takes 8 minutes 30 seconds. There has been some improvements at least...
Comment 6 Xavier Van Wijmeersch 2017-10-29 15:56:57 UTC
with

Version: 6.0.0.0.alpha1+
Build ID: 91987a559bf1fde4a8d1eadc81e5711a7670fe69
CPU threads: 8; OS: Linux 4.9; UI render: default; VCL: kde4; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2017-10-26_23:50:05
Locale: nl-BE (en_US.UTF-8); Calc: group

it takes 52 seconds

Version: 5.4.4.0.0+
Build ID: f95ec59f035ef1f6e9bd2a24e9d69e35edd6e089
CPU threads: 8; OS: Linux 4.9; UI render: default; VCL: kde4; 
Locale: nl-BE (en_US.UTF-8); Calc: group

it takes 66 seconds
Comment 7 QA Administrators 2018-10-30 03:56:23 UTC Comment hidden (obsolete)
Comment 8 Aron Budea 2019-02-23 02:41:36 UTC
Takes ~10 s for me now.
For comparison, in 5.4.0.3 it took ~20 s.

Version: 6.3.0.0.alpha0+ (x64)
Build ID: eef8c4952da288629f9aad23f75d6f894eba83b4
CPU threads: 16; OS: Windows 6.1; UI render: default; VCL: win; 
Locale: hu-HU (hu_HU); UI-Language: en-US
Calc: CL
Comment 9 Roman Kuznetsov 2019-12-30 10:17:53 UTC
(In reply to Aron Budea from comment #8)
> Takes ~10 s for me now.
> For comparison, in 5.4.0.3 it took ~20 s.
> 
> Version: 6.3.0.0.alpha0+ (x64)
> Build ID: eef8c4952da288629f9aad23f75d6f894eba83b4
> CPU threads: 16; OS: Windows 6.1; UI render: default; VCL: win; 
> Locale: hu-HU (hu_HU); UI-Language: en-US
> Calc: CL

it took 34 sec for me in

Version: 6.5.0.0.alpha0+ (x64)
Build ID: 2d736e1a0a2bbd41fe7793d52bbcc7bfc89c7da3
CPU threads: 4; OS: Windows 10.0 Build 18362; UI render: default; VCL: win; 
Locale: ru-RU (ru_RU); UI-Language: en-US
Calc: threaded

Julien, can you make the perfgraph here?
Comment 10 Julien Nabet 2019-12-30 10:26:05 UTC Comment hidden (obsolete)
Comment 11 Julien Nabet 2019-12-30 17:41:43 UTC
Created attachment 156856 [details]
perf flamegraph

Here's a Flamegraph retrieved on pc Debian x86-64 with master sources updated today
Comment 12 Roman Kuznetsov 2019-12-31 15:03:58 UTC
Noel, please can you look at it?
Comment 13 Xisco Faulí 2020-01-07 10:57:59 UTC
For me it takes 26 seconds in

Version: 6.5.0.0.alpha0+
Build ID: bf540873f5e258452fed5006f65a403c95e7872a
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
Calc: threaded
Comment 14 Xisco Faulí 2020-03-25 14:59:05 UTC
Just for the record, the import time changed from

real	0m10,414s
user	0m8,418s
sys	0m0,680s

to

real	0m31,807s
user	0m27,930s
sys	0m2,827s

after https://cgit.freedesktop.org/libreoffice/core/commit/?id=1e55a47e89a9d9d6cf9cb3993484022aaf2c097b which is already reported in bug 124098
Comment 15 Commit Notification 2020-05-25 13:57:02 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/68547fa26897a8076eeda13cdcf20fb6078af6a4

tdf#88109 speed up calc autofill

It will be available in 7.0.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 16 Noel Grandin 2020-05-25 14:04:24 UTC
My apologies, I marked this resolved before I pushed the patch.

It should be much better now, although I think I can still speed it up a little more.
Comment 17 Commit Notification 2020-06-03 06:11:28 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9073a47b99e22585c6d1603dd747cb14f081fca1

tdf#88109 improve autofill perf (2)

It will be available in 7.1.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 18 Commit Notification 2020-06-03 12:32:55 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/a5010d00be3a2dc1c89935d473b20fcbc127da86

tdf#88109 improve autofill perf (2)

It will be available in 7.0.0.1.

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

Affected users are encouraged to test the fix and report feedback.
Comment 19 Xisco Faulí 2020-06-09 11:33:06 UTC
it takes 17 seconds in

Version: 7.1.0.0.alpha0+
Build ID: e0f058bcd5e185b89e4b7c680a7901bc7eb2a790
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

while in

Version: 6.4.0.0.alpha1+
Build ID: 9bc848cf0d301aa57eabcffa101a1cf87bad6470
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded

it takes 78 seconds. Nice improvement.

@Noel, thanks for fixing this issue!!