Bug 90042 - Inserting a lot of strings in cells is slow
Summary: Inserting a lot of strings in cells is slow
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.4.1.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:4.5.0 target:4.4.3
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-16 16:29 UTC by Laurent Godard
Modified: 2015-04-01 12:50 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
sample document with macro to reproduce (1.39 MB, application/vnd.oasis.opendocument.spreadsheet)
2015-03-16 16:29 UTC, Laurent Godard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent Godard 2015-03-16 16:29:20 UTC
Created attachment 114133 [details]
sample document with macro to reproduce

* context

- a "big file" containing 500 sheets, 300 formulas per sheet, 15k named ranges
- a macro loops over namedranges, modifie the value of each one and copy 3 new cells per row

* result

such an heavy process has become very slow. it now takes around 1400 seconds to process

first analysis using callgrind leads to +80% of time spent in
http://opengrok.libreoffice.org/xref/core/sc/source/core/data/document.cxx#3229
that lead to looping over sheets/columns/cells each time
http://opengrok.libreoffice.org/xref/core/sc/source/core/data/column3.cxx#1582

a more refined callgrind trace to come ...

* attachment

the sample document. Hit the the "Go !" button and say ok to the warnbong that th eprocess may take some time
The duration is givent at the end of the process (in second)

do not forget to enable macros before opening
Comment 1 Laurent Godard 2015-03-17 07:54:58 UTC
partial but significant callgrind output
http://oooconv.free.fr/tests/bug90042/callgrind.setStringBigDoc.tar.gz

document SetString call is pointed
mainly called from lcl_PutDataArray
Comment 2 Commit Notification 2015-03-27 23:34:41 UTC
Laurent Godard committed a patch related to this issue.
It has been pushed to "master":

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

tdf#90042 only handle formula group if useful

It will be available in 4.5.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 3 Commit Notification 2015-03-27 23:44:44 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

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

only handle formula group if useful, tdf#90042 related

It will be available in 4.5.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 4 Eike Rathke 2015-03-27 23:58:25 UTC
Pending review at https://gerrit.libreoffice.org/15036 for 4-4
Comment 5 Commit Notification 2015-03-30 10:49:45 UTC
Laurent Godard committed a patch related to this issue.
It has been pushed to "libreoffice-4-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=7042961f4d3e383c04f792a60e96d909b7e44363&h=libreoffice-4-4

tdf#90042 only handle formula group if useful

It will be available in 4.4.3.

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 6 Laurent Godard 2015-04-01 12:50:30 UTC
with the patch, time is around 200 seconds, divided by 7