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

General pipeline optimizations #33

Closed
dekmm opened this issue Jun 30, 2020 · 2 comments
Closed

General pipeline optimizations #33

dekmm opened this issue Jun 30, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@dekmm
Copy link
Contributor

dekmm commented Jun 30, 2020

If at least one of the following conditions are true:

  • the stream is unordered (e.g. the Stream::unordered has been called)
  • the terminal operation does not require the order to be preserved (for example forEach and min)
  • the stream is parallel and terminal operation does not require the order to be preserved for parallel streams

Then, the longest consecutive string of intermediate operations starting from the back that only affects the order of elements (i.e. Sorted) can be removed.

@dekmm dekmm added the enhancement New feature or request label Jun 30, 2020
@dekmm dekmm added this to the 0.1.0 milestone Jun 30, 2020
@dekmm
Copy link
Contributor Author

dekmm commented Aug 9, 2020

It is possible to reorder intermediate operations that are of different types while still preserving Stream equivalence.

Original operation Operations that can be moved before/after the original operation
filter sorted, distinct
sorted filter, distinct
distinct filter, sorted

dekmm added a commit that referenced this issue Aug 10, 2020
@minborg minborg modified the milestones: 0.1.0, 0.1.2, 0.1.3 Aug 31, 2020
@julgus julgus added this to the 1.1.1 milestone Sep 1, 2022
@julgus julgus modified the milestones: 1.1.1, 1.1.2 Dec 2, 2022
@julgus julgus modified the milestones: 1.1.3, 1.1.4 Feb 16, 2023
@julgus julgus modified the milestones: 1.1.4, 1.1.5 Mar 10, 2023
@julgus julgus modified the milestones: 1.1.5, 3.0.1 Apr 11, 2023
@julgus julgus modified the milestones: 3.0.1, 3.0.2 May 26, 2023
@julgus julgus removed this from the 3.0.2 milestone Jun 19, 2023
@julgus julgus added this to the 3.0.3 milestone Jun 19, 2023
@julgus julgus assigned julgus and unassigned dekmm Jun 26, 2023
@julgus
Copy link
Member

julgus commented Jun 28, 2023

Closing this issue as it seems like this was already implemented in RemoveOrderAffectingOperations.

@julgus julgus closed this as completed Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants