RFR: 8196106: Support nested infinite or recursive flat mapped streams
Viktor Klang
vklang at openjdk.org
Tue Apr 9 10:00:38 UTC 2024
On Mon, 8 Apr 2024 16:47:24 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:
> > @PaulSandoz @AlanBateman I've added a commit to this PR which removes the use of Gatherer for Stream::flatMap, but instead implements flatMap for all of the pipelines using the same encoding which Gatherer would use. It seems very competitive performance-wise, and resolves at least one open JBS-issue with flatMap (will look to see if it resolves more than that)
>
> That's a rather clever use of `allMatch`!
Thank you :)
>
> Did you observe performance improvements using `@Stable` on the `cancel` field? It's really hard to predict in the abstract (since the default value of the field will be read in proportion to the number of elements until the stream is cancelled).
I'm currently exploring some different venues for optimization. Stay tuned :)
-------------
PR Comment: https://git.openjdk.org/jdk/pull/18625#issuecomment-2043559783
More information about the core-libs-dev
mailing list