Duplicate :
|
|
Relates :
|
Found this oddity when benchmarking Leyden. Current mainline is behind JDK 17, 21 on basic Leyden reproducer. I bisected the major source of this regression to JDK-8294960. 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-24+0: 38.8 ms ± 0.4 ms Before JDK-8294960: 38.4 ms ± 0.7 ms At JDK-8294960: 41.8 ms ± 0.5 ms current mainline:41.0 ms ± 0.4 ms Mainline improved a bit after, I think, but it looks that JDK-8294960 is the major contributor for regression.