Performance Zone is brought to you in partnership with:

Sarah is a Content Curator at DZone. She lives in Knightdale, NC and enjoys spending her free time reading, crocheting, and playing PC games. Sarah has posted 37 posts at DZone. You can read more from them at their website. View Full User Profile

Java 7 vs. Java 8: Performance Benchmarking of Fork/Join

04.22.2014
| 12675 views |
  • submit to reddit

With the recent release of Java 8, developers are still just beginning to asses the strengths and weaknesses of the new platform. The most pressing question is: Does Java 8 have the fastest JVM so far? A good way to asses the progress of Java 8 is to test its ability to work with something that was new to Java 7... Fork/Join.

Oleg Shelajev uses the "infamous" Java Microbenchmark Harness project (JMH) to create a benchmark test for the two most recent versions of Java. But before implementing the benchmark, he takes the time to give a brief overview of Fork/Join and how it changes between Java 7 and 8.

Here is a graph of the results:

Based on these results, Oleg recommends taking a chance and upgrading to Java 8, especially if you are working with mapreducing or Fork/Join. This is his interpretation of the data that lead him to that conclusion:

One can see that the baseline results, which show the throughput of running the math directly in a single thread do not differ between the JDK 7 and 8. However, when we include the overhead of managing recursive tasks and going through a ForkJoin execution then Java 8 is much faster. The numbers for this simple benchmark suggest that the overhead of managing ForkJoin tasks is around 35% more performant in the latest release.

Check out the full article! It is very informative, has great visuals, and tackles complexity with clarity.

Published at DZone with permission of its author, Sarah Ervin.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)