Profiling and Optimizing Java Streams
Eduardo Rosales (USI Lugano, Switzerland), Matteo Basso (USI Lugano,, Switzerland), Andrea Ros\`a (USI Lugano, Switzerland), Walter Binder (USI, Lugano, Switzerland)

TL;DR
This paper introduces StreamProf, a novel JVM-based profiling tool that measures reference cycle counts in Java streams to identify performance bottlenecks caused by overheads like object allocations and virtual calls.
Contribution
It presents a new cycle-based profiling technique for Java streams, including compensation for instrumentation overhead, and implements the first dedicated JVM stream profiler.
Findings
Cycle profiling effectively detects performance issues in streams.
Instrumentation overhead can be estimated and compensated for.
StreamProf helps optimize stream processing performance.
Abstract
The Stream API was added in Java 8 to allow the declarative expression of data-processing logic, typically map-reduce-like data transformations on collections and datasets. The Stream API introduces two key abstractions. The stream, which is a sequence of elements available in a data source, and the stream pipeline, which contains operations (e.g., map, filter, reduce) that are applied to the elements in the stream upon execution. Streams are getting popular among Java developers as they leverage the conciseness of functional programming and ease the parallelization of data processing. Despite the benefits of streams, in comparison to data processing relying on imperative code, streams can introduce significant overheads which are mainly caused by extra object allocations and reclamations, and the use of virtual method calls. As a result, developers need means to study the runtime…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
