Slight performance optimizations#1
Conversation
Group remote queue, waiting flag, interrupt flag, and interruptor into a single `RuntimeShared` struct to reduce atomic operations and simplify cross-thread coordination
Add `smallvec` dependency and replace fixed-size arrays with `SmallVec` in async task executor and timer for better performance
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 76ab225d8d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ptr::write(&mut (*raw).future, future); | ||
| ptr::write(&mut (*raw).state, state); |
There was a problem hiding this comment.
Avoid referencing uninitialized spawn storage
Every spawned task now goes through this path, and these &mut (*raw).field expressions create mutable references into uninitialized allocated memory before the SpawnFuture exists, which is undefined behavior in Rust even though ptr::write is used afterward. Use raw field pointers such as ptr::addr_of_mut!((*raw).future) / addr_of_mut!((*raw).state) or a Box::new_uninit-based initialization pattern so no reference is formed until the fields are initialized.
Useful? React with 👍 / 👎.
This pull request would introduce some slight performance optimizations:
Weak's into oneWeak.