Why migrate to Java 17? Not because of its performance.
Sample code for my post comparing performance of Java 8 and Java 17.
I am using Java 1.8.0_302 and 17.0.1.
Comes from this article.
- Compile with
mvn clean verify
using Java 8 or Java 17 - Run
java -cp target/startJetty.jar com.acme.performance.Main 40 100
to replay the example in the article - Run
java -jar target/benchmarks.jar
to run the JMH equivalent
My current results are
| | Java 8 | Java 17 | |one | 328.17 | 343.36 | |multi | 60.18 | 66.10 |
Java 17
Benchmark Mode Cnt Score Error Units
MyBenchmark.fibPar avgt 20 82.433 ± 2.607 ms/op
MyBenchmark.fibSeq avgt 20 356.393 ± 0.601 ms/op
Java 8
Benchmark Mode Cnt Score Error Units
MyBenchmark.fibPar avgt 20 71.610 ± 3.832 ms/op
MyBenchmark.fibSeq avgt 20 326.094 ± 0.536 ms/op