February 2014
Beginner
1248 pages
62h 25m
English
Lines 51–60 demonstrate the performance improvement you get by using LongStream method summaryStatistics on a parallel LongStream. To obtain a parallel stream that can take advantage of multi-core processors, simply invoke method parallel on an existing stream. As you can see from the sample output, performing the operations on a parallel stream decreased the total time required even further—taking approximately 55% of the calculation time for the sequential LongStream and just 22% of the time required to perform the five operations separately.
Read now
Unlock full access