|
|
Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
Page 4 of 4
The code based on Java 7's ForkJoinPool was 1.5x times faster than the Java 6 code -- a significant performance gain.
Figures 1 and 2 shows the CPU history for each implementation. Note that CPU usage is pretty much the same, even though the
ForkJoinPool implementation is faster.


While relatively simple, my benchmarks demonstrate that Fork/Join offers serious gains for solving problems that involve recursion.
Because recursion is fundamental to parallel programming on multicore platforms (see Resources) Fork/Join is an essential addition to Java platform concurrency. That said, it does not replace the original java.util.concurrency package. As I've demonstrated, ExecutorService continues to be a fine solution for many concurrent programming tasks. In a programming scenario such as the one I set up,
where effective recursion is key to processing power, Fork/Join is likely to be the most effective solution.
This article has briefly introduced two approaches to Java concurrency and demonstrated each one's applicability to two common
program requirements: data collection and search coverage. See the Resources section to learn more about java.util.concurrency and the uses of Fork/Join in Java 7.
Madalin Ilie is a software development lead at Endava Romania. He has more than five years' programming experience and has worked in a variety of project domains, from mobile development to heavy financial applications.
Read more about Core Java in JavaWorld's Core Java section.
java.util.concurrent and Fork/Join, maintains the Concurrency JSR-166 Interest Site.