yoshuawuyts / futures-concurrency

Structured concurrency operations for async Rust
https://docs.rs/futures-concurrency
Apache License 2.0
414 stars 33 forks source link

Implement better capacity in our group structures #169

Closed yoshuawuyts closed 7 months ago

yoshuawuyts commented 8 months ago

https://github.com/yoshuawuyts/futures-concurrency/pull/168 fixes the immediate insertion time issues of FutureGroup::insert - however the code is, how should I say this, not great?

We need to implement our own exponential capacity algorithm. This means implementing a reserve method which ensures there is enough capacity. And then making sure that if we run out of capacity we always double our space. We may even want to rename some of our existing resize methods to reserve, since they don't take items where Vec::resize does.

This probably needs to be an immediate follow-up to #168; I don't think we should release a new version without it.

yoshuawuyts commented 7 months ago

Porting my comment from https://github.com/yoshuawuyts/futures-concurrency/issues/175:

@matheus-consoli are you still ok to file that PR? If not, feel free to re-assign this to me!

matheus-consoli commented 7 months ago

yes! sorry for the delay, busy week!