A conference talk transcript by Java Champions Cay Horstmann and Maurice Naftalin exploring Java Streams internals and performance. They walk through how stream pipelines are constructed lazily, how terminal operations trigger computation via spliterators, and how the JIT optimizes certain pipeline shapes. Key performance topics include: the overhead of short-circuiting operations like limit, memory costs of distinct and sorted, autoboxing pitfalls with primitive streams, and when parallel streams help vs. hurt (compute-intensive workloads with large data sets are ideal; pipelines with filter+limit or iterate-based sources fail to parallelize effectively). The talk also introduces the Java 23 Gatherers API for custom intermediate operations, with examples like windowed grouping and index-pairing, and explains why some gatherers cannot be parallelized.

47m watch time

Sort: