- 
    Bug 
- 
    Resolution: Duplicate
- 
     P4 P4
- 
    None
- 
    24
- 
    None
                    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
BeforeJDK-8294960: 38.4 ms ± 0.7 ms
AtJDK-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 thatJDK-8294960 is the major contributor for regression.
            
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
At
current mainline:41.0 ms ± 0.4 ms
Mainline improved a bit after, I think, but it looks that
- duplicates
- 
                    JDK-8338542 Umbrella - Reduce startup overhead associated with migration to ClassFile API -           
- Closed
 
-         
- relates to
- 
                    JDK-8294960 Convert java.base/java.lang.invoke package to use the Classfile API to generate lambdas and method handles -           
- Resolved
 
-