Skip to content

WIP: perf(netwatch): enable Apple UDP batch I/O - #244

Closed
ifdario wants to merge 2 commits into
n0-computer:mainfrom
rayfish:perf/apple-fast-datapath
Closed

ifdario wants to merge 2 commits into
n0-computer:mainfrom
rayfish:perf/apple-fast-datapath

Conversation

@ifdario

@ifdario ifdario commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Description

Enable noq-udp's Apple fast path for netwatch sockets when both sendmsg_x and recvmsg_x are available at runtime. This lets the existing UDP transport batch sends and receives on Apple platforms. Systems without both symbols keep the current per-packet path.

The fast-apple-datapath dependency feature is enabled explicitly because UdpSocketState leaves this path disabled until the socket owner opts in.

API Changes

None.

Notes & open questions

The Apple entry points are private APIs. The implementation checks both symbols with dlsym before calling the unsafe opt-in, matching noq-udp's runtime symbol resolution and fallback behavior.

Change checklist

  • Self-review.
  • Documentation updates, where relevant.
  • Tests if relevant.
  • All API changes documented.
  • This PR isn't slop, and is carefully crafted to have the intended effect.
  • cargo make passes locally. (cargo fmt, cargo check -p netwatch --all-targets, cargo test -p netwatch, and Clippy passed; cargo-make is not installed.)

@n0bot n0bot Bot added this to iroh Oct 2, 2026
@github-project-automation github-project-automation Bot moved this to 🚑 Needs Triage in iroh Oct 2, 2026
@flub

flub commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

what's the state of the apple fast data path? When first introduced in upstream quinn-udp it had to be disabled again. But I think there might have been more work to make it safer since then? I'm also mildly surprised it does not yet enabled by default in noq-udp if it is safely supported, what does quinn-udp do there?

@ifdario

ifdario commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

We should actually wait for quinn-rs/quinn#2748 I didn't realized about the partial sends

@flub

flub commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

So, we're closing this for now? if we'll have to still explicitly enable it maybe turn it into an issue?

@ifdario ifdario changed the title perf(netwatch): enable Apple UDP batch I/O WIP: perf(netwatch): enable Apple UDP batch I/O Oct 2, 2026
@ifdario

ifdario commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

Sure, we can also make an issue for later on

@flub flub closed this Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants