Not stagnation, but regression of Java. Where modern Java 17 loses to Java 8

Marian C.
4 min readDec 3, 2021

Most simple demonstration using the code from Java API

Although few recent features might produce an illusion of Java evolution, Java language has not changed much since Java 8.

There are improvements in some built-in classes, but overall improvements in Java performance are not easy to detect.

What if there is a clear degradation in the modern Java performance?

Computational tasks in Java

Java is not as performant as Python, but is more convenient to use for calculations. Let’s make simplest possible experiments to see what happened to computational capacity of the modern Java.

The standard calculation known by anyone is calculation of Fibonacci numbers. In Java it can be done synchronously and even faster through parallel computation. There is even a dedicated class RecursiveTask, so the code is not as complicated as in JavaScript or Python. I try both ways to calculate Fibonacci numbers.

In my code I reuse the sample code from RecursiveTask. The API recommends not to start new tasks for numbers before position 10.

public class Main {static long fibonacci(long n) {
if (n <= 1) {…

--

--

Marian C.
Marian C.

Written by Marian C.

Java, JavaScript and SQL developer. Interested in data collection and visualization.