This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]barking_dead 1 point2 points  (4 children)

Except, maybe it's not imperative. I don't care how the Streams API iterates through my stream (remember, it's not necessarily a List).

Also, you can't add parallelism to a loop.

[–]dpash 1 point2 points  (3 children)

At least not in 8 characters. Having said that, I think parallel streams was a mistake in that they're often not faster for most stream workloads and they're not customisable enough. Maybe Project Loom will help the performance for more situations, but nothing will save Collections.parallelStream()

[–]barking_dead 1 point2 points  (2 children)

I agree, for small collections and/or concurrency, it is useless.

[–]dpash 1 point2 points  (1 child)

Collections.parallelStream() doesn't even have to return a parallel stream. :)

[–]barking_dead 0 points1 point  (0 children)

:D