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

Optimize Iterators #3

Open
ochafik opened this issue Mar 27, 2015 · 1 comment
Open

Optimize Iterators #3

ochafik opened this issue Mar 27, 2015 · 1 comment

Comments

@ochafik
Copy link
Member

ochafik commented Mar 27, 2015

Iterator sources / .toIterator ops should be easy to fit in as long as the final sink is not an Iterator.
(otherwise the source emission logic must be refined)

@ochafik
Copy link
Member Author

ochafik commented Mar 28, 2015

Iterator sources are now supported (List(1).toIterator.map(a).filter(b).{sum, toList} works).
Supporting sinks (i.e. Iterator(1).map(a)) is an interesting subject, will need some thought.

Also TODO is to make Strategies aware of iterators: all the side-effect analysis is needless for iterators (it's precisely there to prevent accidental change of semantic between materialized collections and iterators), but it depends where iterators are in the stream.

For instance: list.map(a).map(b).toIterator.map(c).map(d).toList.map(e). Can't fuse the stream with any safe strategy if a and b both have side-effects, but c and d are okay, etc...

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

No branches or pull requests

1 participant