https://bugs.freedesktop.org/show_bug.cgi?id=45607

             Bug #: 45607
           Summary: LibreOffice calc significantly slower than OpenOffice
                    calc
    Classification: Unclassified
           Product: LibreOffice
           Version: LibO 3.4.5 release
          Platform: x86-64 (AMD64)
        OS/Version: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Spreadsheet
        AssignedTo: libreoffice-bugs@lists.freedesktop.org
        ReportedBy: xabc...@gazeta.pl


Curious about the LibreOffice, I wanted to run my application which was created
in OpenOffice calc. It was a surprise to see a significant difference in
execution time between LO and OO. After isolating the problem, I could measure
the performance in both packages.

Please run the following test macro which fills an area of 200 rows with a
formula in the column 1 and a string in the column 2.

Execution time on my computer:

OpenOffice  3.3.0 -  8 seconds
LibreOffice 3.4.5 - 15 seconds

'**************************************************************************

Sub test
 Const END_ROW As Integer = 199

 Dim document   As Object
 Dim dispatcher As Object

 document   = ThisComponent.CurrentController.Frame
 dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

 Dim oDoc   As Object
 Dim oSheet As Object
 Dim oRange As Object
 Dim oCell  As Object

 oDoc   = ThisComponent
 oSheet = oDoc.getCurrentController.ActiveSheet

 ' Select and clean the test cell range

 oRange = oSheet.getCellRangeByPosition(0, 0, 1, END_ROW)
 oDoc.CurrentController.select(oRange)

 dispatcher.executeDispatch(document, ".uno:ClearContents", "", 0, Array())

 Dim fun As String

 fun = "=SHOW_NUMBER(ROW(); ISBLANK(INDIRECT(""B"" & ROW())))"

 Dim start_time As Long

 start_time = GetSystemTicks()

 ' Fill the test cell range:
 ' column 1: formula for displaying the row number
 ' column 2: a constant string

 Dim row As Integer

 For row = 0 To END_ROW
  oRange = oSheet.getCellRangeByPosition(0, row, 0, row)
  oDoc.CurrentController.select(oRange)
  oCell = oSheet.getCellByPosition(0, row)
  oCell.setFormula(fun)
  oCell = oSheet.getCellByPosition(1, row)
  oCell.String = "abc"
 Next row

 oRange = oSheet.getCellRangeByPosition(0, 0, 0, 0)
 oDoc.CurrentController.select(oRange)

 oRange = oDoc.createInstance("com.sun.star.sheet.SheetCellRanges")
 oDoc.CurrentController.select(oRange)

 Print "Test executed in " + (GetSystemTicks() - start_time)/1000 + " s"
End Sub

'**************************************************************************

Function show_number(ByVal nr As Integer, ByVal empty As Boolean) As String
 show_number = ""
 If Not empty Then
  show_number = Trim(Str(nr)) + "."
 End If
End Function

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to