Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8292021

Performance drop of 15% or more for com.sun.org.apache.xalan.internal.xsltc.trax

    XMLWordPrintable

Details

    • x86_64
    • windows_10
    • Not verified

    Description

      ADDITIONAL SYSTEM INFORMATION :
      OS: windows 10 enterprise

      Java:
      1 openjdk 11.0.13 2021-10-19
      OpenJDK Runtime Environment Temurin-11.0.13+8 (build 11.0.13+8)
      OpenJDK 64-Bit Server VM Temurin-11.0.13+8 (build 11.0.13+8, mixed mode)

      2 openjdk 17.0.3 2022-04-19
      OpenJDK Runtime Environment Temurin-17.0.3+7 (build 17.0.3+7)
      OpenJDK 64-Bit Server VM Temurin-17.0.3+7 (build 17.0.3+7, mixed mode, sharing)

      A DESCRIPTION OF THE PROBLEM :
      We observed the performance drop of 15% or more for com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transorm(), when migrating from openjdk11 to openjdk17

      REGRESSION : Last worked in version 11.0.16

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1 set the test file (we used a xml of 70M called promo-EN-big.xml )
      2 run the test code using openjdk11
      3 run the test code using openjdk12
      4 compare the results

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      openjdk17 performs as good as openjdk11.
      ACTUAL -
      The performance drops 15% and more.

      openjdk11: 731ms ,374ms ,384ms ,324ms ,507ms ,326ms ,329ms ,327ms ,640ms ,324ms ,
      openjdk17: 827ms ,528ms ,575ms ,506ms ,630ms ,509ms ,498ms ,494ms ,756ms ,501ms ,

      ---------- BEGIN SOURCE ----------

      import java.io.File;
      import java.io.StringWriter;
      import javax.xml.parsers.DocumentBuilder;
      import javax.xml.parsers.DocumentBuilderFactory;
      import javax.xml.transform.Transformer;
      import javax.xml.transform.TransformerFactory;
      import javax.xml.transform.dom.DOMSource;
      import javax.xml.transform.stream.StreamResult;
      import org.w3c.dom.Document;

      public class TestTransformerSimple {
      public static void main(String[] args) throws Exception {
      StringWriter writer = new StringWriter();
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      DocumentBuilder builder = factory.newDocumentBuilder();
      Document dom = builder.parse(new File("C:\\test\\promo-EN-big.xml"));

      TransformerFactory formerFactory = TransformerFactory.newInstance(
      "com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl", null);
      Transformer tr = formerFactory.newTransformer();
      StringBuffer rst = new StringBuffer();
      for (int i = 0; i < 10; i++) {

      long begin = System.currentTimeMillis();
      tr.transform(new DOMSource(dom), new StreamResult(writer));
      rst.append(System.currentTimeMillis() - begin).append("ms ,");
      }

      System.out.println(rst);
      rst.setLength(0);
      }
      }
      ---------- END SOURCE ----------

      FREQUENCY : always


      Attachments

        Activity

          People

            tongwan Andrew Wang
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: