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: [email protected]
          Reporter: [email protected]

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.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to