parallelStream() methods (original) (raw)
Brian Goetz brian.goetz at oracle.com
Fri Feb 8 15:28:22 PST 2013
- Previous message: stream() / parallelStream() methods
- Next message: stream() / parallelStream() methods
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Depends how seriously you are counting. Doug counts individual object creations and virtual invocations on the way to a parallel operation, because until you start forking, you're on the wrong side of Amdahl's law -- this is all "serial fraction" that happens before you can fork any work, which pushes your breakeven threshold further out. So getting the setup path for parallel ops fast is valuable.
On 2/8/2013 6:25 PM, Kevin Bourrillion wrote:
On Fri, Feb 8, 2013 at 3:24 PM, Brian Goetz <brian.goetz at oracle.com_ _<mailto:brian.goetz at oracle.com>> wrote:
(Tangentially, I would really love to drop parallelStream() and let people call stream().parallel(). But I haven't managed to scour the archives to find if that argument's already suitably played out.)
Direct version is more performant, in that it requires less wrapping (to turn a stream into a parallel stream, you have to first create the sequential stream, then transfer ownership of its state into a new Stream.) But really a lot of /work/ has already happened by then? -- Kevin Bourrillion | Java Librarian | Google, Inc. |kevinb at google.com <mailto:kevinb at google.com>
- Previous message: stream() / parallelStream() methods
- Next message: stream() / parallelStream() methods
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the lambda-libs-spec-observers mailing list