Skip to content

Use internal iteration in FromIterator and Extend implementations. #43255

Closed
@Stebalien

Description

@Stebalien

Internal iterators (e.g., Iterator::fold(...)) often optimize better (e.g., in Zip, FlatMap, etc...) as they don't need to repeatedly check the entire state of the iterator every iteration. Given that FromIterator and Extend implementations consume the entire iterator, they could use internal iterators and take advantage of this fact.

@bluss?

(I have no benchmarks or code and don't really have time to do anything but suggest that someone else look into this ATM, sorry.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.I-slowIssue: Problems and improvements with respect to performance of generated code.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions