-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
runtime: reduce codegen per task #5213
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Darksonn
added
A-tokio
Area: The main tokio crate
M-runtime
Module: tokio/runtime
labels
Nov 20, 2022
Not really, this focuses on |
carllerche
approved these changes
Nov 21, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks awesome to me. I did a review, but nothing stood out. I like how it shrinks the size of JoinHandle
and AbortHandle
. Nice job, very clever.
carllerche
added a commit
that referenced
this pull request
Dec 5, 2022
- net: fix Windows named pipe connect ([#5208]) - io: support vectored writes for `ChildStdin` ([#5216]) - io: fix `async fn ready()` false positive for OS-specific events ([#5231]) ### Changed - runtime: `yield_now` defers task until after driver poll ([#5223]) - runtime: reduce amount of codegen needed per spawned task ([#5213]) - windows: replace `winapi` dependency with `windows-sys` ([#5204]) [#5208]: #5208 [#5216]: #5216 [#5213]: #5213 [#5204]: #5204 [#5223]: #5223 [#5231]: #5231
carllerche
added a commit
that referenced
this pull request
Dec 5, 2022
### Fixed - net: fix Windows named pipe connect ([#5208]) - io: support vectored writes for `ChildStdin` ([#5216]) - io: fix `async fn ready()` false positive for OS-specific events ([#5231]) ### Changed - runtime: `yield_now` defers task until after driver poll ([#5223]) - runtime: reduce amount of codegen needed per spawned task ([#5213]) - windows: replace `winapi` dependency with `windows-sys` ([#5204]) [#5208]: #5208 [#5216]: #5216 [#5213]: #5213 [#5204]: #5204 [#5223]: #5223 [#5231]: #5231
crapStone
pushed a commit
to Calciumdibromid/CaBr2
that referenced
this pull request
Dec 23, 2022
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [tokio](https://tokio.rs) ([source](https://github.com/tokio-rs/tokio)) | dependencies | minor | `1.22.0` -> `1.23.0` | | [tokio](https://tokio.rs) ([source](https://github.com/tokio-rs/tokio)) | dev-dependencies | minor | `1.22.0` -> `1.23.0` | --- ### Release Notes <details> <summary>tokio-rs/tokio</summary> ### [`v1.23.0`](https://github.com/tokio-rs/tokio/releases/tag/tokio-1.23.0): Tokio v1.23.0 [Compare Source](tokio-rs/tokio@tokio-1.22.0...tokio-1.23.0) ##### Fixed - net: fix Windows named pipe connect ([#​5208]) - io: support vectored writes for `ChildStdin` ([#​5216]) - io: fix `async fn ready()` false positive for OS-specific events ([#​5231]) ##### Changed - runtime: `yield_now` defers task until after driver poll ([#​5223]) - runtime: reduce amount of codegen needed per spawned task ([#​5213]) - windows: replace `winapi` dependency with `windows-sys` ([#​5204]) [#​5208]: tokio-rs/tokio#5208 [#​5216]: tokio-rs/tokio#5216 [#​5213]: tokio-rs/tokio#5213 [#​5204]: tokio-rs/tokio#5204 [#​5223]: tokio-rs/tokio#5223 [#​5231]: tokio-rs/tokio#5231 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC43MC4wIiwidXBkYXRlZEluVmVyIjoiMzQuNzAuMCJ9--> Co-authored-by: cabr2-bot <cabr2.help@gmail.com> Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1687 Reviewed-by: crapStone <crapstone@noreply.codeberg.org> Co-authored-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org> Co-committed-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR should hopefully reduce the amount of code generated per future-type spawned on the runtime. The following methods are no longer generic:
try_set_join_waker
remote_abort
clone_waker
drop_waker
wake_by_ref
wake_by_val
A new method is added to the vtable called
schedule
, which is used when a task should be scheduled on the runtime. E.g.wake_by_ref
will call it if the state change says that the task needs to be scheduled. However, this method is only generic over the scheduler, and not the future type, so it also isn't generated for every task.Additionally, one of the changes involved in the above makes it possible to remove the
id
field fromJoinHandle
andAbortHandle
.