Skip to content
Ken Kousen edited this page Feb 26, 2019 · 1 revision

Welcome to the java_8_recipes wiki!

When is it worthwhile to process in parallel?

  • Operations should be stateless
  • Lot of data, or a lot of time per element
  • The operation must be associative: A op (B op C) == (A op B) op C

|1..25|26..50|51..75|76..100|

When you use a parallel stream, the default implementation is to divide the work into a number of sections equal to the number of processors (common fork-join pool)

Each processor processes its own section

The results are all joined together at the end

Clone this wiki locally