Streams – Below the Surface
summary
Explains how Java Streams build a pipeline from spliterator through intermediate ops to a terminal op, why Gatherers (Java 23) let you write custom intermediate operations and must choose greedy vs non‑greedy and parallelizable or not, and why structure matters: limit/short‑circuiting or tryAdvance vs forEachRemaining can kill parallelism, iterate is unparallelizable, boxing and sort/distinct force big buffers, and a happy case shows parallel speedup 10× while a microbenchmark shows ~20 MB pipeline overhead.
AI-written summary · about
chapters (19)
- 0:00Introduction
- 2:49Why streams are loved
- 6:22Stream performance
- 8:29How streams work
- 10:56Stream pipeline execution
- 14:08Pipeline optimization
- 16:54Memory and boxing costs
- 21:50Memory overhead
- 23:36Parallel streams
- 26:47Parallel stream pitfalls
- 28:54Java 23 gatherers
- 31:44Custom gatherers
- 35:35Common stream mistakes
- 37:20Avoid boxing
- 39:50Iterate limitations
- 41:58Complex pipeline behavior
- 44:30Gatherers limitations
- 45:53Best practices
- 46:55Q&A
related talks
47mWhen Greed Is Good: Understanding Java Stream Performance
43mStream Gatherers - Deep Dive with the Expert
44mThinking in Streams
40mStream Gathers - The biggest change to Java Streams since 10 years
46mThinking in Streams
01h 00mLet’s Get to the Rapids: Java 8 Stream Performance
42mStreams in the Wild
44mLevel Up Your Java Streams with Gatherers
