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

C2: Runtime increase for a double while loop code

XMLWordPrintable

    • generic
    • generic

      ADDITIONAL SYSTEM INFORMATION :
      Java 17.0.7 and Java 21.ea.29 on Linux, tested on a Lenovo T14s and Google Cloud c2-computer-8

      A DESCRIPTION OF THE PROBLEM :
      Significant performance change for a simple parser implementation. The implementation itself already challenges JDK 17 and leads to strange runtime behavior, but when going to 21, it seems to produce even more elevated runtimes.

      It is about the runtimes of B03a (70 --> 100 ns) and B05f (1,000 --> 1,837 ns)

      REGRESSION : Last worked in version 17.0.7

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      See this public repo and execute JMH benchmarks org.xceptance.B03* and org.xceptance.B05f_QuotedWarmupAndUnquotedTest

      There are other test cases, which belong to another defect that will be opened soon.

      https://github.com/rschwietzke/jmh-C2-compile

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      JDK 17.0.7 provides these runtimes:

      B03a: 70 ns
      B03b: 447 ns
      B03c: 669 ns
      B05f: 1,000 ns
      ACTUAL -
      JDK 21.ea.20 provides these runtimes:

      B03a: 100 ns
      B03b: 430 ns
      B03c: 690 ns
      B05f: 1,837 ns

      ---------- BEGIN SOURCE ----------
      https://github.com/rschwietzke/jmh-C2-compile

      https://github.com/rschwietzke/jmh-C2-compile/blob/main/src/main/java/org/xceptance/B03a_ShortWarmupAndTest.java
      https://github.com/rschwietzke/jmh-C2-compile/blob/main/src/main/java/org/xceptance/B03b_UnquotedWarmupAndTest.java
      https://github.com/rschwietzke/jmh-C2-compile/blob/main/src/main/java/org/xceptance/B03c_QuotedWarmupAndTest.java
      https://github.com/rschwietzke/jmh-C2-compile/blob/main/src/main/java/org/xceptance/B05f_QuotedWarmupAndUnquotedTest.java
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Rewrite the code under tests change the runtime behavior.

      FREQUENCY : always


            mchevalier Marc Chevalier
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: