StreamProf is a dedicated stream (i.e., java.util.stream package) profiler for the Java Virtual Machine (JVM). StreamProf builds upon the DiSL and Shadow VM frameworks, both enabling the complete instrumentation of the Java class library in which the Stream API is implemented.
StreamProf accurately intercepts every stream executed by a Java application, measuring the computations performed by a stream in terms of elapsed reference cycles (i.e., clock cycles elapsed during an operation, collected at nominal processor frequency, regardless of frequency scaling). With StreamProf, developers can use cycle profiling to locate problematic streams with a major impact on application performance. While accuracy is crucial to this goal, the inserted instrumentation code causes the execution of extra cycles, which are partially included in the profiles. To mitigate this issue, StreamProf estimates and compensates for the extra cycles caused by the inserted instrumentation code.
StreamProf also helps developers find that the accurate profiling of tasks supporting parallel stream processing allows the diagnosis of load imbalance according to the distribution of stream-related cycles at a thread level. Overall, StreamProf is suitable for helping developers optimize modern sequential and parallel stream-based workloads whose optimization can enable significant performance gains (e.g., up to a factor of 5x in Renaissance). To the best of our knowledge, StreamProf is the first cycle-accurate stream profiler for the JVM.
Downloads
An artifact showcasing StreamProf can be downloaded here.
Key Publications
[1] Eduardo Rosales, Matteo Basso, Andrea Rosà, Walter Binder: Profiling and Optimizing Java Streams. 2023: 7(3): 10:1-10:39 [pdf][slides]