Java "for" loop vs "stream" (1)
- taolius
- Aug 23, 2018
- 1 min read
(https://dzone.com/articles/performance-with-java8-streams)
In Java8 Streams, performance is achieved by parallelism, laziness, and using short-circuit operations.
In Java Streams, parallelism is achieved by using the Fork-Join principle. As per the Fork-Join principle, it divides larger tasks into smaller sub-tasks (known as forking), and then processes the sub-tasks in parallel to utilize all the available hardware, then combines the results together (known as Join) to form an integrated result.
Comments