Concerns about parallel streams

Brian Goetz brian.goetz at oracle.com
Fri Jul 12 08:40:40 PDT 2013


> Anyway, as you might recall or surmise, from day one,
> my main fear about all this was: Oh great, now billions
> of people are all going to start blaming ME for all their
> performance problems :-)

I think "Doug gets blamed" is just an axiom of the Java universe.  No 
sense arguing with gravity...

But, we have seen this movie before.  Remember java.util.concurrent, how 
many people took away the wrong message about when to use the big new 
hammers?  (One edition of the Deitel book changed all their examples 
from synchronized to explicit locks, causing a whole generation of 
students to learn the wrong thing, and his excuse was "but you told us 
how much better they were...")

Sam's point is that, while *we* know that parallelism is a sharp tool 
and should be used with care, by making it so easy, we have dived 
head-first into the moral hazard pool.  While the answer is not "ok, 
then make it harder", we should at least make some attempt to educate 
about why .parallel() is not magic performance dust.

There's nothing wrong with a "Parallel Performance for Dummies" section 
in the package doc.  (Either that, or someone should write a book.)


More information about the lambda-libs-spec-observers mailing list