Constructing parallel streams (original) (raw)
Brian Goetz brian.goetz at oracle.com
Mon Dec 10 07:50:07 PST 2012
- Previous message: Constructing parallel streams
- Next message: Constructing parallel streams
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I don't like users being able to call parallel in the middle of the stream construction.
I don't love it either. The semantics are perfectly tractible, and the implementation is perfectly straightforward, but the performance is unlikely to be a win in most cases. (I mentioned earlier we would doc that this really should only be done at the head of the pipeline.)
I propose to have an interface ParallelizableStream that allows to choose if the user want the sequential or the parallel stream upfront.
Yeah, we investigated this direction first. Combinatorial explosion: IntParallelizableStream, etc.
However, this could trivially become a dynamic property of streams (fits easily into the existing stream flags mechanism). Then only the head streams would have the property, and if you tried to do parallel() farther down the stream, we could ignore it or even throw ISE.
- Previous message: Constructing parallel streams
- Next message: Constructing parallel streams
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the lambda-libs-spec-experts mailing list