Skip to content

iterators are for very large things, arrays are not #4

@michaelficarra

Description

@michaelficarra

When talking to @rbuckton about this proposal, he brought up that, even if we had this and you passed some very large array, it's still going to have terrible performance because it will iterate the entire thing using the iteration protocol. And sure, we could special-case arrays, or more generally optimise the iteration protocol for arrays, but I think that's a band-aid. Iterator.concat is a constant-time operation. I would think that most of the times that people run into this issue, they would be better served by switching to use iterators instead. Maybe it's not a bad thing that this fails? Is there a case where people are working with such large data and still need array-like behaviour such as constant-time indexing or length checking?

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