-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.P-lowLow priorityLow priority
Description
Good evening. I ran across a missed optimization I was trying to convert std::result::collect
into using FromIteratator
. My initial version used iter::Scan
, but it proved to be 2 times slower than at --opt-level=3
than the original implementation. I also created a custom iterator that doesn't have the closure, and it compiles down to the same speed as the original std::result::collect
. I'm guessing llvm isn't able to inline the closure for some reason.
I've gathered up this test in a gist. Note that in this example, the Scan1::size_hint()
is different than the std::iter::Scan::size_hint()
method.
cc @thestinger
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.P-lowLow priorityLow priority