Common Java Streams Mistakes (part 3): Applying Inefficient Operations with Parallel Streams

preview_player
Показать описание
This video shows the limitations of using inherently sequential Java streams operations (such as iterate() and limit()) in the context of parallel streams.
Рекомендации по теме
Комментарии
Автор

Since the stream source (IntStream.range, Stream.iterate) is ordered and the stream destination is also ordered (collecting to arrayList), then the stream is being processed in an ordered manner even for parallel mode. So perhaps using unordered() will help improve the parallel performance..

timwalters