-
Notifications
You must be signed in to change notification settings - Fork 138
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
Task.select is no longer used and can potentially impact performance negatively #217
Conversation
e2da860
to
f36d902
Compare
Is there any public discussion on this? Curious what alternatives folks should be using to "race" tasks, and what performance pitfalls should be avoided. |
So the discussion has been centered around the Sendability of the AsyncIterator's of the different algorithms. Basically the issue becomes that spawning a full-on Task (not a child task) per iteration is not only incorrect per the requirement of The tl;dr is that you should avoid creating a |
Since this is a deletion without replacement I do want to have discussion on what use cases we still need to address in a more general sense. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that we should remove this at least for the initial release since it encourages to use unstructured Concurrency. As we have learned ourselves here, the issues are solvable with the usage of some structured concurrency. While we still need to spawn Task
s for the consumption of upstream sequences we never need to race them.
Racing things is quite useful, though. We do so in an ad hoc way with task groups in some of our projects that I think could be nicer. If not with |
I agree on the general utility; however I really think that it needs to occur at a much lower level than the current interfaces available. My thought is to collect information on it and the use cases to provide solid ground for someone to take up the mantle as a pitch/proposal for the concurrency library. |
This sounds good to me, let's remove and re-add when we gain more experience and use-cases, hopefully a more efficient take on it then. |
After iteration with folks on a number of the algorithms we no longer need
Task.select
. This particular item has some distinct performance impacts that are perhaps not ideal for general use and ends up pushing (in the realms ofAsyncSequence
iteration) perhaps dubious value.Since we are at a pre-1.0 it would be better to remove this now and re-evaluate its need later (if at all).