Skip to content

Slight performance optimizations#1

Draft
DorianNiemiecSVRJS wants to merge 5 commits into
mainfrom
feat/slight-optimizations
Draft

Slight performance optimizations#1
DorianNiemiecSVRJS wants to merge 5 commits into
mainfrom
feat/slight-optimizations

Conversation

@DorianNiemiecSVRJS

Copy link
Copy Markdown
Member

This pull request would introduce some slight performance optimizations:

  • Replacing heap-allocated vectors with stack-allocated ones in timer wheel.
  • Grouping together some task Weak's into one Weak.
  • Pin-heap-allocating spawned futures.

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
@DorianNiemiecSVRJS
DorianNiemiecSVRJS marked this pull request as draft June 18, 2026 09:12
@DorianNiemiecSVRJS

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread vibeio/src/executor.rs
Comment on lines +95 to +96
ptr::write(&mut (*raw).future, future);
ptr::write(&mut (*raw).state, state);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant