Speedup for the Computationally Intensive App

The counting primes examples was trivial, but it showed that for computationally intensive operations a fair balance of workload among parts is critical.

We had to choose the partition size and the pool size. Let’s see what effect these two factors have on the performance. I ran the program in client mode (because it takes longer to run than server mode, and that makes it easier to compare the results) on a eight-core processor. The measure of performance is shown in Figure 3, Primes calculation in client mode on an eight-core processor: effect of pool size and parts.

images/divideAndConquer/concurrentprimes.png
Figure 3. Primes calculation ...

Get Programming Concurrency on the JVM now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.