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

            Bug ID: 165918
           Summary: Quadratic complexity when loading a document with lots
                    of bookmarks and lots of tables
           Product: LibreOffice
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Keywords: perf
          Severity: normal
          Priority: medium
         Component: Writer
          Assignee: [email protected]
          Reporter: [email protected]

Created attachment 200025
  --> https://bugs.documentfoundation.org/attachment.cgi?id=200025&action=edit
A large number of small tables with bookmarks

Attached is the following ODF markup repeated 20 000 times:

   <table:table>
    <table:table-column/>
    <table:table-column/>
    <table:table-row>
     <table:table-cell office:value-type="string">
      <text:p><text:bookmark-start text:name="Bookmark
1"/>abc<text:bookmark-end text:name="Bookmark 1"/></text:p>
     </table:table-cell>
     <table:table-cell/>
    </table:table-row>
    <table:table-row>
     <table:table-cell/>
     <table:table-cell/>
    </table:table-row>
   </table:table>
   <text:p/>
   <text:p/>

(the index of the bookmark increments each time). It takes significant time to
open; and that time depends on the repeat count in a non-linear way, even when
opening the document in hidden mode, e.g. using code like this:

  prop = new com.sun.star.beans.PropertyValue
  prop.Name = "Hidden"
  prop.Value = true 'create hidden
  ticks = GetSystemTicks
  doc =
StarDesktop.loadComponentFromURL(ConvertToURL("path/to/tableWithBookmark_20000.fodt"),
"_default", 0, array(prop))
  ticks = GetSystemTicks - ticks
  MsgBox ticks
  doc.close(True)

E.g., on my system, limiting the document to 5000 copies gives times around
1940 ticks; 10000 copies take ~2390 ticks; 20000 copies take ~5790 ticks; 40000
copies need ~17700 ticks.

The part of loading procedure that creates the non-linear complexity needs
optimization.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to