[Libreoffice-bugs] [Bug 129166] New: XCellRangeData::setDataArray is many times slower when data contains some empty strings

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Tue Dec 3 20:57:00 UTC 2019


https://bugs.documentfoundation.org/show_bug.cgi?id=129166

            Bug ID: 129166
           Summary: XCellRangeData::setDataArray is many times slower when
                    data contains some empty strings
           Product: LibreOffice
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Keywords: perf
          Severity: normal
          Priority: medium
         Component: BASIC
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: mikekaganski at hotmail.com

Consider the code

> sub DataArray
>   const maxRow = 900000
>   dim data(0 to maxRow)
>   for i = 0 to maxRow
>     if (i mod 10 = 0) Then data(i) = array("0") else data(i) = array(CStr(i))
>   next i
>   range = ThisComponent.Sheets(0).getCellRangeByPosition(0,0,0,maxRow)
>   t = now()
>   range.setDataArray(data())
>   MsgBox Format(now() - t, "[s] "" s""")
> end sub

Running in a new spreadsheet, setDataArray takes ~7-8 s on my system.

But replacing `array("0")` with `array("")` makes it execute longer than ~800
s. So the empty strings in the data array slow down the function manyfold.

Tested with Version: 6.3.4.1 (x64)
Build ID: a21169d87339dfa44546f33d6d159e89881e9d92
CPU threads: 12; OS: Windows 10.0; UI render: GL; VCL: win; 
Locale: ru-RU (ru_RU); UI-Language: en-US
Calc: threaded

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20191203/82ffb9dc/attachment.html>


More information about the Libreoffice-bugs mailing list