Skip to content
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

Open
2 of 7 tasks
jonas-schievink opened this issue Mar 8, 2020 · 4 comments
Open
2 of 7 tasks

Tracking Issue for Coroutine Memory Usage #69826

jonas-schievink opened this issue Mar 8, 2020 · 4 comments
Labels
A-async-await Area: Async & Await A-codegen Area: Code generation A-coroutines Area: Coroutines AsyncAwait-Triaged Async-await issues that have been triaged during a working group meeting. F-coroutines `#![feature(coroutines)]` I-heavy Issue: Problems and improvements with respect to binary size of generated code. metabug Issues about issues themselves ("bugs about bugs") T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@jonas-schievink
Copy link
Contributor

jonas-schievink commented Mar 8, 2020

(old issue: #52924)

This issue tracks ideas for reducing the memory footprint of coroutines.

Note that this issue is different from #69663, which tracks typesystem-level improvements regarding coroutines. This issue is purely about the code generation aspect.

@jonas-schievink jonas-schievink added A-codegen Area: Code generation T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC A-coroutines Area: Coroutines I-heavy Issue: Problems and improvements with respect to binary size of generated code. A-async-await Area: Async & Await F-coroutines `#![feature(coroutines)]` labels Mar 8, 2020
@tmandry tmandry added the AsyncAwait-Triaged Async-await issues that have been triaged during a working group meeting. label Mar 17, 2020
tylerwhall added a commit to tylerwhall/rmp-futures that referenced this issue Apr 21, 2022
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
@pnkfelix
Copy link
Member

pnkfelix commented Sep 9, 2022

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

@rustbot rustbot added metabug Issues about issues themselves ("bugs about bugs") and removed C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC labels Sep 9, 2022
@oli-obk
Copy link
Contributor

oli-obk commented Sep 9, 2022

This is now being tracked as a github project: https://github.com/orgs/rust-lang/projects/21/views/1?layout=board

@Thomasdezeeuw
Copy link
Contributor

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

@oli-obk
Copy link
Contributor

oli-obk commented Sep 9, 2022

hmm

Only organization owners can change project visibility.

Looking how to fix that, sorry

@oli-obk oli-obk changed the title Tracking Issue for Generator Memory Usage Tracking Issue for Coroutine Memory Usage Oct 21, 2023
jplatte added a commit to matrix-org/matrix-rust-sdk that referenced this issue Nov 3, 2023
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
jplatte added a commit to matrix-org/matrix-rust-sdk that referenced this issue Nov 3, 2023
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
jplatte added a commit to matrix-org/matrix-rust-sdk that referenced this issue Nov 3, 2023
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
ti-chi-bot bot added a commit to tikv/tikv that referenced this issue Feb 21, 2024
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 <[email protected]>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
ti-chi-bot bot pushed a commit to tikv/tikv that referenced this issue Mar 18, 2024
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 <[email protected]>

Co-authored-by: Neil Shen <[email protected]>
dbsid pushed a commit to dbsid/tikv that referenced this issue Mar 24, 2024
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 <[email protected]>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
Signed-off-by: dbsid <[email protected]>
ti-chi-bot bot added a commit to tikv/tikv that referenced this issue May 22, 2024
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 <[email protected]>

Co-authored-by: Neil Shen <[email protected]>
Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-async-await Area: Async & Await A-codegen Area: Code generation A-coroutines Area: Coroutines AsyncAwait-Triaged Async-await issues that have been triaged during a working group meeting. F-coroutines `#![feature(coroutines)]` I-heavy Issue: Problems and improvements with respect to binary size of generated code. metabug Issues about issues themselves ("bugs about bugs") T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants