Releases: yoshuawuyts/futures-concurrency
v7.2.0
What's Changed
- feat: Implement
Zip
for tuples up to 12 elements by @poliorcetics in #125 - feat: Implement
Chain
for tuples up to 12 elements by @poliorcetics in #124 - feat: Implement
TryJoin
for tuples up to 12 elements by @poliorcetics in #122 - Remove unecessary
core::fmt::Debug
requirements by @poliorcetics in #123 - nit: use constant to call recursive macro once instead of several times by @poliorcetics in #121
- Add extension traits by @yoshuawuyts in #128
- update future docs by @yoshuawuyts in #131
Full Changelog: v7.1.1...v7.2.0
v7.1.1
What's Changed
- shuffle vec/array/tuple futures/streams for benchmark by @wishawa in #117
- updated the documentation examples for crates.io by @yoshuawuyts
New Contributors
Full Changelog: v7.1.0...v7.1.1
v7.1.0
Added
- Add happy eyeballs example by @eholk in #93
- Add initial implementation of
RaceOk
for tuples by @matheus-consoli in #109
Changed
- Make Debug impl for AggregateError more readable by @eholk in #94
- Remove need for
tuple_for_each!
,tuple_len!
and simplifygen_conditions!
a lot by @poliorcetics in #99 - Remove
MaybeDone
from tuple::join by @matheus-consoli in #103 - Remove
MaybeDone
fromarray::race_ok
by @matheus-consoli in #107 - Improve RaceOk error format for array impl by @Alastair-smith2 in #108
- replace rng with deterministic indexer by @yoshuawuyts in #104
- Implement perfect waking for array/vec Join by @Swatinem in #110
- Implement "perfect" waking for
tuple::merge
by @matheus-consoli in #96 - Update description by @yoshuawuyts in #101
Fixed
- Fix docs links by @matheus-consoli in #95
- Fix typos by @kianmeng in #102
- Fix Race docs and cleanup unused items by @poliorcetics in #100
- Correctly drop errors for
RaceOk
impls on tuples by @matheus-consoli in #112 - Fix a possible memory leak on the impl of
Join
for tuples by @matheus-consoli in #113
New Contributors
- @poliorcetics made their first contribution in #99
- @kianmeng made their first contribution in #102
- @Alastair-smith2 made their first contribution in #108
- @Swatinem made their first contribution in #110
Full Changelog: v7.0.0...v7.1.0
v7.0.0
Highlights
Futures-concurrency is a library prototyping async/.await
-based concurrency operations intended for inclusion in the stdlib. This effort is lead by Yosh, as part of the Rust Async WG.
Library Priorities
As part of the Rust Async WG we're working towards a proposal for a base set of "futures concurrency" operations we can add to the stdlib. This library serves as a testing ground for those APIs, enabling us to experiment separately from the stdlib. And for users of stable Rust to use the futures concurrency operators without relying on nightly.
What's change in this release over v6.0.0
is that we recognize that this library isn't just a prototype for the stdlib. It needs to be usable standalone as well. This means rather than using core::async_iter::AsyncIterator
, we opt to use the ecosystem-standard futures_core::Stream
instead. This enables this library to be used in production, enabling testing and benchmarking to take place, all while still working towards inclusion in the stdlib.
Performance
Another focus in this release has been on performance. We've added a modest suite of benchmarks to the repository, and used that to track our performance optimizations. The main performance optimization we've found is the implementation of "perfect waking". When a futures-concurrency future is woken, it now only wakes the futures which were scheduled to be woken - and no more. Together with some other optimizations this has lead to drastic performance improvements across the APIs where we've implemented it:
group v6.0.1 (prev release) v7.0.0 (curr release)
array::merge 10 1.46 4.2±0.28µs 1.00 2.9±0.05µs
array::merge 100 7.60 365.5±13.01µs 1.00 48.1±1.44µs
array::merge 1000 20.88 39.2±1.49ms 1.00 1877.5±57.35µs
vec::merge 10 1.73 4.9±0.31µs 1.00 2.9±0.05µs
vec::merge 100 8.33 360.6±3.84µs 1.00 43.3±0.80µs
vec::merge 1000 17.67 38.0±0.41ms 1.00 2.2±0.06ms
We've only implemented it for two APIs so far - but that already has shown a 30%-95% performance improvement. They're synthetic benchmarks, and probably not entirely represenative. But the fact that we're making headway in removing unnecessary wakes has knock-on effects as well. If for whatever reason there are futures in a codebase where spurious waking may be expensive (not ideal, but we've seen it happen), this will ensure that doesn't end up negatively affecting performance. Meaning depending on the scenario, the benefits here may actually show up in application performance.
Zip and Chain
We've started work on two new traits: stream::Zip
and stream::Chain
. These now exist in addition to stream::Merge
, providing control over order of execution. Unlike their stdlib Iterator
counterparts, we've chosen to expose this functionality as separate traits. Not only does that enable seamless switching between merge
, zip
, and chain
semantics. It als prevents tuple-nesting when combining more than two streams together:
let s1 = stream::repeat(0).take(5);
let s2 = stream::repeat(1).take(5);
let s3 = stream::repeat(2).take(5);
// With the `StreamExt::zip` method
let s = (s1).zip(s2).zip(s3);
while let Some(((n1, n2), n3))) = s.next().await {
assert_eq!((n1, n2, n3), (0, 1, 2));
}
// With the `Zip` trait
let s = (s1, s2, s3).zip();
while let Some((n1, n2, n3)) = s.next().await {
assert_eq!((n1, n2, n3), (0, 1, 2));
}
Support for arrays and vectors has landed, with support for tuples expected soon. This requires generating some macros like we have for merge
already, and we just haven't quite gotten around to that yet. Soon!
Changelog
Added
- Implement
stream::Merge
for tuples up to length 12 by @yoshuawuyts in #19 - Implement Join for 0 and 1 length tuples by @yoshuawuyts in #40
- Init zip and chain traits by @yoshuawuyts in #73
Changed
- Remove IntoFuture definition by @yoshuawuyts in #31
- Revert away from async traits by @yoshuawuyts in #24
- Remove the custom
Stream
definition by @yoshuawuyts in #35 - Format debug output by @yoshuawuyts in #36
- Make implementation of
Race
for tuple fair by @matheus-consoli in #58
Fixed
- Make impl of Join for single element tuple return single elmnt tuple by @matheus-consoli in #86
Internal
- Add miri to ci by @yoshuawuyts in #27
- Remove
MaybeDone
fromimpl Join for Vec
by @yoshuawuyts in #29 - Expose tuple futures from path by @yoshuawuyts in #26
- Re-export the structs by @yoshuawuyts in #34
- Init bench by @yoshuawuyts in #46
- Reuse inline wakers by @yoshuawuyts in #51
- Implement "perfect" waking for
impl Merge for Vec
(1/2) by @eholk in #50 - Add more benchmarks by @yoshuawuyts in #52
- Fix clippy warnings by @matheus-consoli in #54
- Switch Readiness to use bitvec by @matheus-consoli in #53
- Fix bench saving by @yoshuawuyts in #56
- Clippying ci by @matheus-consoli in #55
- Remove duplication of
gen_conditions
by @matheus-consoli in #59 - Use
array::from_fn
to safely create output array ofMaybeUninit
by @matheus-consoli in #60 - Inline random number generator by @yoshuawuyts in #61
- Streamline futures benches by @yoshuawuyts in #64
- Implement "perfect" waking for
impl Merge for Vec
(2/2) by @yoshuawuyts in #57 - Avoid allocation for small length in PollState tracking by @michaelwoerister in #78
- Remove
Fuse
fromimpl Merge for array
by @yoshuawuyts in #70 - Make
{array,vec}::race
fair by @yoshuawuyts in #71 - Remove
MaybeDone
fromimpl Join for array
by @yoshuawuyts in #72 - Inline
poll_states
and removeFuse
forvec::merge
by @yoshuawuyts in #79 - Author initial comparative benchmarks by @yoshuawuyts in #80
- Push fixes from #79 by @yoshuawuyts in #89
- Perfect waker for
array::Merge
by @yoshuawuyts in #75 - Provide const variants of the utils/ types by @yoshuawuyts in #81
- Hide PollState variants by @matheus-consoli in #92
- Move test channel to utils by @matheus-consoli in #91
New Contributors
- @eholk made their first contribution in #50
- @matheus-consoli made their first contribution in #54
- @michaelwoerister made their first contribution in #78
Full Changelog: v6.0.1...v7.0.0
Read the Documentation: https://docs.rs/futures-concurrency/7.0.0/