Uploaded image for project: 'Xerces2-J'
  1. Xerces2-J
  2. XERCESJ-1742

Make `DatatypeException` stackless (JDK‑8283994)

    XMLWordPrintableJSON

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

      Original attachments:

      Attachments

        Activity

          People

            Unassigned Unassigned
            ExE Boss ExE Boss
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: