Use internal iteration in FromIterator and Extend implementations. #43255
Labels
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
I-slow
Issue: Problems and improvements with respect to performance of generated code.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
Internal iterators (e.g.,
Iterator::fold(...)
) often optimize better (e.g., inZip
,FlatMap
, etc...) as they don't need to repeatedly check the entire state of the iterator every iteration. Given thatFromIterator
andExtend
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.)
The text was updated successfully, but these errors were encountered: