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

Fix performance of Stream.from(Blocking)Iterator when using large chunk sizes #3392

Merged
merged 1 commit into from
Feb 19, 2024

Conversation

mpilquist
Copy link
Member

@mpilquist mpilquist commented Feb 18, 2024

When passing large chunk sizes to Stream.fromBlockingIterator, CPU is wasted calling hasNext on an empty iterable -- chunkSize - i.size times.

Noticed this when passing Int.MaxValue for chunk size and an operation took over 3 minutes longer than it should have.

@mpilquist mpilquist merged commit ce6392e into typelevel:main Feb 19, 2024
15 checks passed
@mpilquist mpilquist deleted the topic/from-iterator-perf branch February 19, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants