-
Notifications
You must be signed in to change notification settings - Fork 663
Closed
Description
I spent some time in investigating sizes of async functions, and discovered that the usage of join!
lead to a doubling of the required size for a future.
After looking into the associated code, I think the move/copy of the joined futures is the issue:
$(
// Move future into a local so that it is pinned in one place and
// is no longer accessible by the end user.
let mut $fut = $crate::future::maybe_done($fut);
)*
While this seems harmless, these operations add up, and every composition layer can double the future size. And moving futures in the 10kB+ range is costly and wasting memory.
Maybe there are other ways to do this too. E.g. requiring already pinned futures and polling these in-place? With an extra-layer that stack-pins futures that are not yet pinned?
There are probably also a few other combinators which inhibit the same behavior.
Metadata
Metadata
Assignees
Labels
No labels