On Wed, 8 Nov 2023 21:08:03 GMT, Viktor Klang <vkl...@openjdk.org> wrote:
>> This Pull-Request implements [JEP-461](https://openjdk.org/jeps/461) > > Viktor Klang has updated the pull request incrementally with two additional > commits since the last revision: > > - Addressing review feedback > - Make Gatherer.andThen take a wildcard for the rhs Gatherer state type src/java.base/share/classes/java/util/stream/GathererOp.java line 301: > 299: * the output. This is highly beneficial in the parallel case as > stateful > 300: * operations cannot be pipelined in the ReferencePipeline > implementation. > 301: * Overriding collect-operations overcomes this limitation. Does this mean that .parallel().gather(myGatherer).map(smth).collect(..) will be slower than .parallel().gather(myGatherer.andThen(mappingGatherer(smth))).collect(..)? Also, what about other terminals (e.g. reduce())? Will they require processing all the upstream before reduction? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16420#discussion_r1389147792