Debloat your async Rust
15 points by fanf
15 points by fanf
This is something I'm currently dealing with at work because we decided fairly early on to use async streams.
Overall, I have to say it is a pleasant enough interface to use, but the bloat is real,
opening tokio-console shows a dozen futures with sizes well in the 5000 bytes, and not using/not understanding how pin-project works early-on lead to a whole lot of extra Pin<Box<_>> in structs, absolutely trashing the heap with small allocations.
Async Rust, as it is right now, makes it really easy to shoot yourself in the foot. I highly recommend turning on clippy large-futures when starting a new async Rust project.