Post
Yep, we notice it acutely! bsky.app/profile/jame...
None of these are *deal breakers*: and should not be a reason to NOT use async/await, IMO. But on embedded we feel the pain of increased code size + ram usage much more acutely, and sometimes it requires being careful to avoid pathological cases. That doesn't feel good.
github.com/rust-lang/ru... is an easy go-to, but in general yeah there's a lot of very-not-optimized codegen going on wrt generators/futures.
github.comAsync fn doubles argument size · Issue #62958 · rust-lang/rustGenerator optimization in #60187 by @tmandry reused generator locals, but arguments are still duplicated whenever used across yield points. For example (playground): #![feature(async_await)] async ...
and github.com/rust-lang/ru... is a neat fix for at least some of that.
github.comMove coroutine upvars into locals for better memory economy by dingxiangfei2009 · Pull Request #135527 · rust-lang/rustReplace #127522
Related to #62958
The problem statement
#62958 demonstrates two problems. One is that upvars are always unconditionally promoted to prefix data fields of the state machine; the othe...
0 reposts6 likes
No replies yet.