Skip to content

Optimize Lazy Seqs #209

Open
Open

Description

@halgari

Can we get the JIT to completely remove the overhead of lazy seqs? I'll be looking into this before the 0.2 release. I'd like to see: (reduce + 0 (map inc (map dec (range 10)))) basically compile down to a loop. I know transducers could be used to do this, and they are already fast, but it'd be nice to get the JIT to allocation removal for seqs as well.

Activity

  1. self-assigned this
    on Mar 2, 2015
  2. added this to the 0.2 Release milestone on Mar 2, 2015
  3. halgari commented on Mar 17, 2015

    @halgari
    MemberAuthor

    I've done some work on this, and it seems that the "run once" semantics of lazy seqs make the JIT really unhappy. We may just have to tell the JIT to stop tracing whenever it hits a lazy seq function. This will improve performance a bit (about 20% in my tests), but doesn't really get to the goal I would like to hit, but I'm not even sure that's possible. I'll ask on the PyPy mailing list to see if anyone has ideas.

  4. halgari commented on May 1, 2015

    @halgari
    MemberAuthor

    Something else I'm considering is to have map produce vectors vs lazy seqs. Will benchmark this a bit.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions