Skip to content

Optimize Iterators #3

Open
Open

Description

@ochafik

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)

Activity

  1. ochafik commented on Mar 28, 2015

    @ochafik
    MemberAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions