~/talk

Make Your CPU Cores Sweat with Parallel Streams

Talkat Oracle OpenWorld 2017 · 2017-10-01..10-05· [java]
links:none on file
slides:none on file

Explains how Java 8 parallel streams run on the common ForkJoinPool (threads ~= CPU cores), use the fork/join framework and Spliterator.trySplit to divide work, and often give real wins (example shows ~5x speedup for a CPU-heavy pipeline) but also real hazards: linked lists and iterative generators split poorly and boxing can double cost, and a naive attempt to sum 1 billion boxed elements can 1 billion crash the JVM heap; avoid shared mutable accumulators, prefer CPU-bound, measurable changes.

AI-written summary · about

  1. 0:00Intro
  2. 0:37What is CERN?
  3. 2:20Manipulating collections before Java 8
  4. 4:04Manipulating data with streams
  5. 6:03Threads (JDK 1) Invocation of a thread results in a new path of execution Thread API is still great for simple asynchronous tasks and background processing
  6. 7:05Executor Service (JDK 5) Java 5 introduced several new APIs that simplify design and development of multi-thread applications
  7. 8:18Parallel Streams (JDK 8) The Stream library enables you to execute operations in parallel without much effort Under the hood it employs the forkjoin framework and the Spliterator
  8. 11:58Fork/Join Framework (JDK7) Fork
  9. 18:58F/J Framework and Parallel Streams
  10. 20:53Custom F/J Pool for a Parallel Stream(s)?
  11. 30:30Decomposing LinkedList and ArrayList Always take into account how well the stream source decomposes
  12. 33:09Decomposing various stream sources
  13. 34:12Decomposability and Auto(un)boxing
  14. 36:33findAny () and unordered ()
  15. 41:54sequential() and parallel()
  16. 44:24Conclusions
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.