rustasync / runtime

Empowering everyone to build asynchronous software
https://docs.rs/runtime
Apache License 2.0
862 stars 28 forks source link

Consider using smallbox for Box::pin allocations #39

Closed yoshuawuyts closed 4 years ago

yoshuawuyts commented 5 years ago

We have a bunch of Box::pin() allocations in the bindings between runtime-raw and actual runtime implementations.

Every future gets boxed because we want to be generic over runtimes. A lot of those boxed futures are small so we could store them into SmallBox provided by this crate: https://docs.rs/smallbox/0.7.3/smallbox/index.html. We should consider trying this out.