Small startup regression remains after JDK-8309622 and JDK-8331932

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 24
    • Affects Version/s: 23, 24
    • Component/s: core-libs
    • None
    • b13

      Found this oddity when benchmarking Leyden. JDK 23 is behind JDK 17, 21 on basic Leyden reproducer. I bisected the major source of this regression to JDK-8309622. A related JDK-8331932 improved the startup overheads a bit, but not completely.

      Here:

      ```
      % cat HelloStream.java
      import java.util.*;
      import java.util.stream.*;

      public class HelloStream {
          public static void main(String ... args) {
              var words = List.of("hello", "fuzzy", "world");
              var greeting = words.stream()
                  .filter(w -> !w.contains("z"))
                  .collect(Collectors.joining(", "));
              System.out.println(greeting); // hello, world
          }
      }

      % rm -f *.class *.jar
      % $J/bin/javac HelloStream.java
      % $J/bin/jar cf hellostream.jar *.class

      % hyperfine -w 50 -r 100 '$J/bin/java -Xmx256m -XX:+UseSerialGC -cp hellostream.jar HelloStream'
      ```

      jdk-23+0: 37.2 ms ± 0.2 ms
      Before JDK-8309622: 37.1 ms ± 0.3 ms
      At JDK-8309622: 38.5 ms ± 0.3 ms
      At JDK-8331932: 37.8 ms ± 0.3 ms

            Assignee:
            Claes Redestad
            Reporter:
            Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: