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

            Bug ID: 56854
           Summary: XMLBeans performance when using getXXXList() and other
                    proxy methods
           Product: POI
           Version: unspecified
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
          Assignee: [email protected]
          Reporter: [email protected]

The XMLBeans recommendation is that when accessing long XML documents, or
when performance matters, one should use XmlCursor and not getXXXList().

In order to provide a short-term solution, I propose we sweep the
code and replace all usages of getXXXList() with getXXXArray() -  which is
much faster since it creates a snapshot of the xml data instead of a live
view.

This will be trivial for read-only operations (e.g. bug #56556) and easy
for write operations – just read the array, work on it or create a new one,
and set the result back to the proxy.

Also, some attempts to minimize this – using toArray() on the returned
list, can be reduced to getXXXArray(), since toArray() iterates over the
elements, which is very inefficient in the XmlBeans impl.

We should decide how to document the new (and old) usages of getXXXArray(),
which are deprecated (and probably will be as long as the XMLBeans project is
dead) -
either by ignoring it altogether, or by adding @SuppressWarnings("deprecation")
on all usages (thus always using a variable) optionally with a comment
describing why the deprecated method is used (e.g. a link to this bug).

In addition, other methods (e.g. CTCol.getMax()) are sometimes called several
times in the same scope when their result is not changing, which is another
redundant piece of XMLBeans code being called.

-- 
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