https://issues.apache.org/bugzilla/show_bug.cgi?id=55882

            Bug ID: 55882
           Summary: Severe performance degradation when writing large
                    numbers of custom properties to .DOCX/.XLSX files
           Product: POI
           Version: 3.8
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: POI Overall
          Assignee: [email protected]
          Reporter: [email protected]

Created attachment 31112
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31112&action=edit
NetBeans profile snapshot of test of standard POI library

When writing very large numbers of properties to the Custom Properties
collection of new style office documents, the performance degrades badly.
A test of writing 3k properties to a .DOCX file took 400 seconds.

In my time trials, monitoring timing each batch of 25 property writes, the
first batch of 25 entries took 0.028 seconds, the batch at the 1k mark took 1.1
seconds, the batch at 2k took 4.3 seconds, and the batch at 3K took 10.1
seconds.  I have reason to believe the size of the dataset may reach much
larger than 3k.

When profiling the code, most of the time in adding a property was spent in
org.apache.poi.POIXMLProperties.addProperty()->org.apache.poi.POIXMLProperties.add()->org.apache.poi.POIXMLProperties.cotains().
 
I tested a custom compile of POI with the call to .contains() removed, most of
the time was spent in
org.apache.poi.POIXMLProperties$CustomPropertiex.nextPid(). Within that, most
of the time was to java.util.AbstractList$Itr.hasNext() followed by
java.util.AbstractList$Itr.next()

Another test of the custom POI library without the call to .contains() for 3k
properties took roughly 200 seconds, or half the time of the standard library.

My test was a loop appending the loop counter number to both the base name and
base value text to be used in the property, forex "prop_Name_0001",
"prop_value_0001"

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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to