About 92,200 results
Open links in new tab
  1. java - Should I always use a parallel stream when possible? - Stack ...

    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: myShapesCollec...

  2. How many threads are spawned in parallelStream in Java 8?

    Jun 12, 2015 · The Oracle's implementation [1] of parallel stream uses the current thread and in addition to that, if needed, also the threads that compose the default fork join pool …

  3. java - How Java8's Collection.parallelStream works? - Stack Overflow

    Jul 8, 2014 · The infrastructure used behind the scenes by parallel streams to execute operations in parallel is the fork/join framework introduced in Java 7. It’s vital to have a good understanding of the …

  4. lambda - java 8 parallelStream () with sorted () - Stack Overflow

    JDK 8 EA is out now, and I am just trying to get used to the lambda and the new Stream API. I've tried to sort a list with parallel stream, but the result is always wrong: import java.util.ArrayLi...

  5. java - parallelStream vs stream.parallel - Stack Overflow

    May 6, 2017 · I have been curious about the difference between Collections.parallelStream() and Collections.stream().parallel(). According to the Javadocs, parallelStream() tries to return a parallel …

  6. java - How many threads parallelStream () creates when given only one ...

    Jul 22, 2022 · 3 How many threads parallelStream() creates when given only one list as input? Under the hood of parallel streams Fork-Join framework is being used.

  7. Java parallel stream: how to wait for threads for a parallel stream to ...

    Jan 12, 2018 · Java parallel stream: how to wait for threads for a parallel stream to finish? Asked 7 years, 11 months ago Modified 1 year, 4 months ago Viewed 28k times

  8. forEach vs forEachOrdered in Java 8 Stream - Stack Overflow

    Sep 26, 2015 · For sequential streams the forEach seems to respect the order and even stream API internal code uses forEach (for stream which is known to be sequential) where it's semantically …

  9. Difference between java 8 streams and parallel streams

    Aug 2, 2015 · I wrote code using Java 8 streams and parallel streams for the same functionality with a custom collector to perform an aggregation function. When I see CPU usage using htop, it shows all …

  10. How to ensure order of processing in Java 8 streams?

    Apr 9, 2024 · You are asking the wrong question. You are asking about sequential vs. parallel whereas you want to process items in order, so you have to ask about ordering. If you have an ordered …