streams.next / Stream Fusion
|streams.next / Stream Fusion|
|Convenor: Cay Horstmann, Alex Petrov|
(sorry, didn't keep track)
We talked about some shortcomings of java.util.stream in Java 8.
Some of these shortcomings were conscious decisions by the expert group. We were aware of these:
There isn't much going to change in Java 9. There is just one known new method in j.u.s: to turn an Optional into a Stream of length 0 or 1. Not a game changer :-)
We noted that there are two distinct use cases for streams.
Perhaps surprisingly, the first use case is quite narrow. For stream parallelization to be effective,
** They must not block ** The work must be sufficient to pay for setting up the computation
These use cases exist, but they are not common in business applications. In an app server in particular, it seems unwise to go full-bore utilising all cores in a servlet response :-)
That makes the second use case far more compelling for streams, and it would be nice to have more comfortable stream operations in the API.
There are several libraries that aim to improve on Java 8 streams. The following came up:
Recommendations go here