News for hackers. Stuff that matters.
Re:Rust async-await status report 2 by devit on Wednesday July 10, 2019 @12:59PM (#20403849)
The most efficient way of executing a non-I/O function is to just use the thread stack to store its data and optimize it for speed rather than for using little stack space.

However, for functions that can block indefinitely on I/O, then such an approach would mean keeping an inefficiently-large stack around indefinitely.

Hence, the better solution is to put the data on the heap, ideally in a manually engineered structure (i.e. "manual implementation of futures"), or for more ergonomics in one efficiently designed by the compiler (i.e. async/await).

There are no comments on this comment yet.