From Concurrent to Parallel
summary
Argues that parallelism is an optimization distinct from concurrency and demonstrates Java SE 8 parallel streams built on ForkJoin for divide‑and‑conquer tasks. Shows arrays split cheaply and get strong speedups, boxed Integers suffer cache misses and can be slower, linked‑list or encounter‑order sources split poorly. Measures matter: chunk work of a few hundred cycles (roughly 50–500 elements) is a good rule, and expensive merges (e.g., collecting into maps/sets) can cause a 4× slowdown at ~10k items.
AI-written summary · about
chapters (18)
- 0:00Introduction
- 1:03Hardware Context
- 4:39Concurrency
- 16:46Parallelism is a lost cause
- 18:33Bad Habits
- 20:31Using Concurrent
- 23:41Parallel Decomposition
- 25:48Combining Results
- 26:35Dynamic Decomposition
- 29:15Does this work
- 30:49ForkJoin
- 31:48Streams
- 32:52Example
- 34:37Splitting
- 36:46Locality
- 38:52Encounter Order
- 40:36Merging
- 43:33Summary
related talks
01h 01mFrom Concurrent to Parallel
46mMake Your CPU Cores Sweat with Parallel Streams
01h 00mLet’s Get to the Rapids: Java 8 Stream Performance
45mThe Power and Perils of Parallel Streams
02h 35mParallel and Asynchronous Programming with Streams and CompletableFuture
48mParallel Streams, CompletableFuture, and All That: Concurrency in Java 8
41mParallel Programming, Fork Join, and Reducers
54mParallel-Ready Java Code: Managing Mutation in an Imperative Language
