The primary purpose of parallelstreams in the recent release of java 8 is to help java programs make better use of multi-core processors for improved performance. However, in some cases, parallelstreams can actually...
详细信息
ISBN:
(纸本)9783030011741;9783030011734
The primary purpose of parallelstreams in the recent release of java 8 is to help java programs make better use of multi-core processors for improved performance. However, in some cases, parallelstreams can actually perform considerably worse than ordinary sequential java code. This paper presents a Map-Reduce parallel programming pattern for java parallel streams that produces good speedup over sequential code. An important component of the Map-Reduce pattern is two optimizations: grouping and locality. Three parallel application programs are used to illustrate the Map-Reduce pattern and its optimizations: Histogram of an Image, Document Keyword Search, and Solution to a Differential Equation. A proposal is included for a new terminal stream operation for the java language called MapReduce() that applies this pattern and its optimizations automatically.
javastreams enable an easy-to-use functional-like programming style that transparently supports parallel execution. This paper presents an approach that improves the performance of stream-based java applications. The...
详细信息
ISBN:
(纸本)9783031061561;9783031061554
javastreams enable an easy-to-use functional-like programming style that transparently supports parallel execution. This paper presents an approach that improves the performance of stream-based java applications. The approach enables the effective usage of java for HPC applications, due to data locality improvements (i.e., support for efficient data layouts), without losing the object-oriented view of data in the code. The approach extends the java collections API to hide additional details concerning the data layout, enabling the transparent use of more memory-friendly data layouts. The enhanced java Collection API enables an easy adaptation of existing java codes making those java codes suitable for HPC. Performance results show that improving the data locality can provide a two-fold performance gain in sequential stream applications, which translated into a similar gain over parallel stream implementations. Moreover, the performance is comparable to similar C implementations using OpenMP.
暂无评论