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
BeforeJDK-8309622: 37.1 ms ± 0.3 ms
AtJDK-8309622: 38.5 ms ± 0.3 ms
AtJDK-8331932: 37.8 ms ± 0.3 ms
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
At
At
- relates to
-
JDK-8309622 Re-examine the cache mechanism in BaseLocale
- Resolved
-
JDK-8331932 Startup regressions in 23-b13
- Resolved
- links to
-
Commit(master) openjdk/jdk/a98ecad0
-
Review(master) openjdk/jdk/20713