RFR: 8154387 - Parallel unordered Stream.limit() tries to collect 128 elements even if limit is less
paul.sandoz at oracle.com
Tue Apr 19 16:57:36 UTC 2016
> On 19 Apr 2016, at 18:28, Tagir F. Valeev <amaembo at gmail.com> wrote:
> webrev is updated in-place (just added parentheses):
> Updated benchmark source and results are available here:
> In general I observe that for low-Q filter (x -> true) the results are
> also improved as well as for
> -Djava.util.concurrent.ForkJoinPool.common.parallelism=1. My tests
> were performed on 4-core machine (no hyperthreading), thus default
> parallelism is 4.
Thanks, this looks good.
> The LEAF_TARGET version does not change the results significantly. If
> you feel that using LEAF_TARGET is more suitable I can update webrev
It has some appeal, since there is a symmetry to using that and the threshold at which the wrapping spliterator will no longer be split by F/J tasks. Up to you.
More information about the core-libs-dev