Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Library] Remove allocation overhead in Iterator#collect #9681

Merged
merged 1 commit into from
Jun 30, 2021

Conversation

sirthias
Copy link
Contributor

Small optimization in Iterator#collect.

Currently a function instance is instantiated on every element test.
Since this function does not depend on the actual element the extra allocations can be eliminated completely.

@scala-jenkins scala-jenkins added this to the 2.13.7 milestone Jun 29, 2021
Copy link
Member

@lrytz lrytz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thank you @sirthias

@lrytz lrytz merged commit f611f6c into scala:2.13.x Jun 30, 2021
@sirthias
Copy link
Contributor Author

Thank you, Lukas, for the quick merge!

@SethTisue SethTisue added library:collections PRs involving changes to the standard collection library performance the need for speed. usually compiler performance, sometimes runtime performance. labels Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
library:collections PRs involving changes to the standard collection library performance the need for speed. usually compiler performance, sometimes runtime performance.
Projects
None yet
4 participants