Should I always use a parallel stream when possible?

With Java 8 and lambdas it’s easy to iterate over collections as streams, and just as easy to use a parallel stream. Two examples from the docs, the second one using parallelStream: myShapesCollection.stream() .filter(e -> e.getColor() == Color.RED) .forEach(e -> System.out.println(e.getName())); myShapesCollection.parallelStream() // <– This one uses parallel .filter(e -> e.getColor() == Color.RED) .forEach(e -> … Read more