ParallelStream Vs Stream Digest, Vol 113, Issue 94
wasserman.louis at gmail.com
Fri Sep 30 06:39:53 UTC 2016
You should absolutely not assume parallel streams are faster than
http://gee.cs.oswego.edu/dl/html/StreamParallelGuidance.html is pretty much
the iconic document on that subject, and explains circumstances under which
parallelism is good, and when it is likely to be harmful.
On Thu, Sep 29, 2016 at 10:07 PM Prakhar Makhija <matcdac at gmail.com> wrote:
> The application makes a hit to a core object over and over again. I have to
> copy this object, i.e. make a clone of it using the Cloneable interface, so
> that the original object cannot be modified. But since the references of
> the old object and clone object would be intact, inside the clone method I
> am explicitly copying the List Map and Set using parrallelStream/stream.
> The hardware is i3 processor with 8GB RAM and 1TB hard disk.
> So you mean to say, Parallel Stream is good for large data set?
> On Sep 30, 2016 10:08 AM, "David Holmes" <david.holmes at oracle.com> wrote:
> > On 30/09/2016 2:24 PM, Prakhar Makhija wrote:
> >> Hi everyone,
> >> I have started using both Stream and ParallelStream, for Set List and
> >> Entry
> >> of Map.
> >> What I can't understand is why Stream is taking lesser time than
> >> ParallelStream.
> >> Shouldnt ParallelStream be giving better performance than Stream in
> >> of Time Complexity?
> > Depends on the data set size and your hardware, and what exactly you are
> > trying to do in parallel.
> > David
More information about the core-libs-dev