Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
2.12.2
-
None
-
None
Description
See JDK-8283994:
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:
catch (InvalidDatatypeValueException ex) { fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN, ex.getKey(), ex.getArgs(), XMLErrorReporter.SEVERITY_ERROR ); }
...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%.