ExE Boss created XERCESJ-1742:
---------------------------------

             Summary: Make `DatatypeException` stackless (JDK‑8283994)
                 Key: XERCESJ-1742
                 URL: https://issues.apache.org/jira/browse/XERCESJ-1742
             Project: Xerces2-J
          Issue Type: Improvement
          Components: JAXP (javax.xml.validation)
    Affects Versions: 2.12.2
            Reporter: ExE Boss


See [JDK-8283994|https://bugs.openjdk.java.net/browse/JDK-8283994]:

{quote}
Profiling of SPECjvm2008:xml.validation shows there are lots of 
InvalidateDataTypeValueExceptions are thrown from Xerces. See screenshot for 
async-profiler stack trace.

It does not look like those exceptions leak outside javax.xml. The uses of 
exception or its subclasses ({{InvalidDatatypeValueException}}, 
{{InvalidDatatypeFacetException}}) take the form of:

{code:java}
                catch (InvalidDatatypeValueException ex) {
                    fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
                                               ex.getKey(),
                                               ex.getArgs(),
                                               XMLErrorReporter.SEVERITY_ERROR 
);
                }
{code}

...so they don't seem to use the stack traces: only key, args, message is used. 
Which means we can turn {{DatatypeException}} stackless, and save some cycles 
on throws.

This improves xml.validation performance for about +3%.
{quote}

h2. Original attachments:
 * 
[xml-validation-exceptions.png|https://bugs.openjdk.java.net/secure/attachment/98402/xml-validation-exceptions.png]



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: j-dev-h...@xerces.apache.org

Reply via email to