-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking Issue for Coroutine Memory Usage #69826
Comments
Unfortunately Rust doesn't inline async functions, even for tail calls. Each level of indirection adds to the state size and that can scale with the amount of calls into the library. Remove some avoidable uses of async to help memory usage somewhat until Rust fixes these issues. rust-lang/rust#69826
Visiting during T-compiler backlog bonanza. This isn't the same kind of "tracking issue" that we associated with the C-tracking-issue label (in terms of a specific feature being designed) @rustbot label: +metabug -C-tracking-issue |
This is now being tracked as a github project: https://github.com/orgs/rust-lang/projects/21/views/1?layout=board |
@oli-obk that link is either incorrect or the project is private, in either case it doesn't work |
hmm
Looking how to fix that, sorry |
RoomInfo is often passed around by value, including in futures where holding types with a large stack size is especially problematic¹. It might make sense to move the actual data of (Base)RoomInfo into an inner struct that is always held inside a Box or Arc, but this change should have most of the benefits of that while being a bit simpler. ¹ rust-lang/rust#69826
RoomInfo is often passed around by value, including in futures where holding types with a large stack size is especially problematic¹. It might make sense to move the actual data of (Base)RoomInfo into an inner struct that is always held inside a Box or Arc, but this change should have most of the benefits of that while being a bit simpler. ¹ rust-lang/rust#69826
RoomInfo is often passed around by value, including in futures where holding types with a large stack size is especially problematic¹. It might make sense to move the actual data of (Base)RoomInfo into an inner struct that is always held inside a Box or Arc, but this change should have most of the benefits of that while being a bit simpler. ¹ rust-lang/rust#69826
close #16540 *: enable linters about async and futures We should be pedantic about writing async code, as it's easy to write suboptimal or even bloat code. See: rust-lang/rust#69826 *: remove unnecessary async blocks to save memory This commit favors FutureExt::map over async blocks to mitigate the issue of async block doubled memory usage. Through the sysbench oltp_read_only test, it was observed that this adjustment resulted in approximately 26% reduction in memory usage. See: rust-lang/rust#59087 Signed-off-by: Neil Shen <overvenus@gmail.com> Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
close #16540 *: enable linters about async and futures We should be pedantic about writing async code, as it's easy to write suboptimal or even bloat code. See: rust-lang/rust#69826 *: remove unnecessary async blocks to save memory This commit favors FutureExt::map over async blocks to mitigate the issue of async block doubled memory usage. Through the sysbench oltp_read_only test, it was observed that this adjustment resulted in approximately 26% reduction in memory usage. See: rust-lang/rust#59087 Signed-off-by: Neil Shen <overvenus@gmail.com> Co-authored-by: Neil Shen <overvenus@gmail.com>
close tikv#16540 *: enable linters about async and futures We should be pedantic about writing async code, as it's easy to write suboptimal or even bloat code. See: rust-lang/rust#69826 *: remove unnecessary async blocks to save memory This commit favors FutureExt::map over async blocks to mitigate the issue of async block doubled memory usage. Through the sysbench oltp_read_only test, it was observed that this adjustment resulted in approximately 26% reduction in memory usage. See: rust-lang/rust#59087 Signed-off-by: Neil Shen <overvenus@gmail.com> Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com> Signed-off-by: dbsid <chenhuansheng@pingcap.com>
close #16540 *: enable linters about async and futures We should be pedantic about writing async code, as it's easy to write suboptimal or even bloat code. See: rust-lang/rust#69826 *: remove unnecessary async blocks to save memory This commit favors FutureExt::map over async blocks to mitigate the issue of async block doubled memory usage. Through the sysbench oltp_read_only test, it was observed that this adjustment resulted in approximately 26% reduction in memory usage. See: rust-lang/rust#59087 Signed-off-by: Neil Shen <overvenus@gmail.com> Co-authored-by: Neil Shen <overvenus@gmail.com> Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
(old issue: #52924)
This issue tracks ideas for reducing the memory footprint of coroutines.
size_of_val
in a generator can make the generator bigger #62321 –size_of_val
in a generator can make the generator biggerNote that this issue is different from #69663, which tracks typesystem-level improvements regarding coroutines. This issue is purely about the code generation aspect.
The text was updated successfully, but these errors were encountered: