Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Currently parallel-stream will start doing work the second it's initialized. This is much the same as
The downsides are that we're both spawning more tasks than needed, which interferes with the ability of the compiler to inline futures, which in turn will impact performance. Also there's no backpressure.
The solution to this seems to be to move "task spawning" to the edge methods:
There's probably some nuance here; for example
However something to be mindful of is that calling
Perhaps we can learn from futures-rs terminology here, and the max concurrency (#3) is not only the upper bound of futures executing simultaneously. But also the amount of futures that have (potentially) been completed, are now buffered, and are waiting to be read.
This is an interesting one it seems.
On the topic of ordering: some discussion occurred on reddit, but I think that we should: