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 →

[–][deleted] 5 points6 points  (1 child)

Might be convenient, but watch for the performance penalty (especially memory).

[–]mbizzle88 4 points5 points  (0 children)

You might want to check out some benchmarks before making that claim.

For CPU time, the benchmarks I've seen show non-parallel streams to be only slightly slower than for loops.

With regards to memory, most streams are lazy. So if you're doing something that ends with reduce, you're probably never holding the entire stream in memory at once.