For one - some performance examples (specifically, integer array iteration) is 15 times slower with streams.
Angelika Langer's analysis:
https://jaxenter.com/java-performance-tutorial-how-fast-are-...
For one - some performance examples (specifically, integer array iteration) is 15 times slower with streams.
Angelika Langer's analysis:
https://jaxenter.com/java-performance-tutorial-how-fast-are-...
That's a very misleading example, and even the linked post itself explains why it is so (e.g. not much is done with the integers in the first place).
Array: 453 ms Stream: 887 ms Parallel stream: 120 ms
The array loop code is about twice as fast as the sequential stream (parallel stream blows both of them away). The array loop advantage will start to go away once you increase the complexities of what you're doing in the loop and, of course, the stream code is much more readable.
(Edit: I also tested IntStream().of() instead Array().stream() for the sequential stream test, the results were identical in both cases.)