Thursday, June 15, 2017

http://fahdshariff.blogspot.com/2016/06/java-8-completablefuture-vs-parallel.html

CompletableFutures provide more control over the size of the thread pool and should be used if your tasks involve I/O. However, if you're doing CPU-intensive operations, there's no point in having more threads than processors, so go for a parallel stream, as it is easier to use.

No comments: