Only run this macro, it opens new Calc file and puts the strings to the 100k rows in column A. It is very slow in 7.3.0.1. Sub SlowSetDataArray const c=100000 dim oDoc as object, oSheet as object, i&, data(c), oRange as object oDoc=StarDesktop.LoadComponentFromUrl("private:factory/scalc", "_Blank", 0, array()) 'new file oSheet=oDoc.Sheets(0) for i=0 to c data(i)=array(CStr(i)) 'speed tragedy, about 40 seconds; but in 7.2.4.1 it is OK, about 1 second 'data(i)=array(i) 'fast, OK, about 1 second next i oRange=oSheet.getCellRangeByPosition(0, 0, 0, c) oRange.setDataArray(data) End Sub bugged: Version: 7.3.0.1 (x64) / LibreOffice Community Build ID: 840fe2f57ae5ad80d62bfa6e25550cb10ddabd1d CPU threads: 8; OS: Windows 10.0 Build 17763; UI render: Skia/Raster; VCL: win Locale: cs-CZ (cs_CZ); UI: cs-CZ Calc: CL OK in: Version: 7.2.4.1 (x64) / LibreOffice Community Build ID: 27d75539669ac387bb498e35313b970b7fe9c4f9 CPU threads: 8; OS: Windows 10.0 Build 17763; UI render: Skia/Raster; VCL: win Locale: cs-CZ (cs_CZ); UI: cs-CZ Calc: CL
Regression introduced by: https://cgit.freedesktop.org/libreoffice/core/commit/?id=b9e2c5d2a36fbd189c20448cadf4212edf02914d author Andreas Heinisch <andreas.heinisch@yahoo.de> 2021-11-04 11:50:51 +0100 committer Eike Rathke <erack@redhat.com> 2021-11-08 23:04:54 +0100 commit b9e2c5d2a36fbd189c20448cadf4212edf02914d (patch) tree 17bc34c956f818beb3cfbcba764f53fcd119511f parent 140b90d30b30bddfda44b81e26284807807ab518 (diff) tdf#142033 - Handle embedded newline set via SetDataArray Bisected with: bibisect-linux64-7.3 Adding Cc: to Andreas Heinisch
I have a fix in mind and will test it later. Maybe my idea works for targeting the performance issue here.
Proposed patch: https://gerrit.libreoffice.org/c/core/+/127660 If I add a check for a multiline string, the time goes down from 220 to 5 seconds for the setDataArray function using plain strings in 7.4.0.0.alpha0+. However, in 7.2.3.2 (x64) the setDataArray call takes 1 second. So there is still something which slows down the performance of the setDataArray function outside of this change.
Andreas Heinisch committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/2d11710df6d81c03007d136667a443e09cc70eed tdf#146454 - Check for multiline string in setDataArray It will be available in 7.4.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.
i do confirm the issue is fixed in Version: 7.4.0.0.alpha0+ / LibreOffice Community Build ID: 2d11710df6d81c03007d136667a443e09cc70eed CPU threads: 8; OS: Linux 5.10; UI render: default; VCL: gtk3 Locale: es-ES (es_ES.UTF-8); UI: en-US Calc: threaded now it takes 6 seconds, before the fix, it takes 1 min 27 seconds
Andreas Heinisch committed a patch related to this issue. It has been pushed to "libreoffice-7-3": https://git.libreoffice.org/core/commit/b1e2d386afc3174d79a11fcfe365bf3a51f0caef tdf#146454 - Check for multiline string in setDataArray It will be available in 7.3.0.2. 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.
Andreas Heinisch committed a patch related to this issue. It has been pushed to "libreoffice-7-2": https://git.libreoffice.org/core/commit/5ee413d78cfc1cbfbe7c05f0c21c40ffb32f572a tdf#146454 - Check for multiline string in setDataArray It will be available in 7.2.6. 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.
I confirm the fix in Version: 7.3.0.2 (x64) / LibreOffice Community Build ID: f1c9017ac60ecca268da7b1cf147b10e244b9b21 CPU threads: 8; OS: Windows 10.0 Build 17763; UI render: Skia/Raster; VCL: win Locale: cs-CZ (cs_CZ); UI: cs-CZ Calc: CL In my computer about 2 seconds. I tried the milion rows and 15sec in 7.2.3.2 also in 7.2.4.1 and also in 7.3.0.2.