Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

to*Map with merge function and grouping* with ordered downstream: allow concurrent collection for unordered source #18

Open
amaembo opened this issue Oct 30, 2015 · 0 comments

Comments

@amaembo
Copy link
Owner

amaembo commented Oct 30, 2015

Methods StreamEx.toMap(keyMapper, valMapper, mergeFunction), StreamEx.toSortedMap(keyMapper, valMapper, mergeFunction), EntryStream.toMap(mergeFunction), EntryStream.toSortedMap(mergeFunction), EntryStream.toCustomMap(mergeFunction, mapSupplier) do not use concurrent collection for parallel stream as mergeFunction is not guaranteed to be commutative. However if stream is unordered it's still possible to use concurrent collection, so it should be implemented. This way user may explicitly call .unordered() to speed up the results.

The same applies for EntryStream.grouping(downstream), EntryStream.grouping(supplier, downstream), StreamEx.groupingBy(classifier, downstream), StreamEx.groupingBy(classifier, supplier, downstream): currently parallel concurrent collection is used only for unordered downstream collector. It could be used also for unordered source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant