~/talk

When Greed Is Good: Understanding Java Stream Performance

Talkat JCON EUROPE 2026 · 2026-04-20..04-23· [java]
links:none on file
slides:none on file

Explains how Java streams actually execute by showing JMH benchmarks, JITWatch assembly, and flame graphs that reveal surprising costs: adding a limit produces a 50% slowdown with limit in one microbenchmark, parallelizing a suitable workload gives 14x speedup on 14 cores, and cancellation checks dominate runtime when pipelines short-circuit. Demonstrates the Java 25 gatherer API with a zip-with-index example, contrasts greedy vs non-greedy gatherers, and recommends profiling hot pipelines before rewriting to loops.

AI-written summary · about

  1. 0:00Introduction and speaker background
  2. 4:53Why use Java streams
  3. 10:10Debugging stream pipeline internals
  4. 14:05JIT inlining in stream operations
  5. 16:32Impact of adding limit to streams
  6. 23:18Parallel streams performance pitfalls
  7. 29:03Introducing Java 25 gatherers
  8. 34:46Greedy vs picky gatherers
  9. 40:11Performance conclusions and recommendations
  10. 43:01Q&A session
~/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.