Skip to content

feat: Enable the Apple fast datapath#3455

Merged
mxinden merged 5 commits into
mozilla:mainfrom
larseggert:feat-apple-fast-datapath
Mar 30, 2026
Merged

feat: Enable the Apple fast datapath#3455
mxinden merged 5 commits into
mozilla:mainfrom
larseggert:feat-apple-fast-datapath

Conversation

@larseggert
Copy link
Copy Markdown
Collaborator

Unconditionally in neqo-bin, but with plumbing so Gecko can probe and enable it conditionally.

@larseggert larseggert force-pushed the feat-apple-fast-datapath branch from 8e32c67 to 255bb97 Compare March 14, 2026 16:49
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Mar 14, 2026

Merging this PR will not alter performance

✅ 24 untouched benchmarks
⏩ 27 skipped benchmarks1


Comparing larseggert:feat-apple-fast-datapath (a067fdc) with main (4288d22)

Open in CodSpeed

Footnotes

  1. 27 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 14, 2026

Codecov Report

❌ Patch coverage is 81.81818% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.23%. Comparing base (efd595b) to head (a067fdc).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3455      +/-   ##
==========================================
- Coverage   94.29%   94.23%   -0.07%     
==========================================
  Files         127      131       +4     
  Lines       38739    39081     +342     
  Branches    38739    39081     +342     
==========================================
+ Hits        36529    36827     +298     
- Misses       1371     1408      +37     
- Partials      839      846       +7     
Flag Coverage Δ
freebsd 93.23% <50.00%> (-0.10%) ⬇️
linux 94.29% <50.00%> (+<0.01%) ⬆️
macos 94.24% <81.81%> (+0.06%) ⬆️
windows 94.29% <50.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
neqo-common 98.49% <ø> (ø)
neqo-crypto 86.90% <ø> (ø)
neqo-http3 93.95% <ø> (+0.04%) ⬆️
neqo-qpack 95.02% <ø> (+0.21%) ⬆️
neqo-transport 95.25% <ø> (+0.02%) ⬆️
neqo-udp 83.40% <81.81%> (+0.42%) ⬆️
mtu 86.61% <ø> (ø)

@larseggert larseggert force-pushed the feat-apple-fast-datapath branch from 255bb97 to 127d9ff Compare March 14, 2026 17:22
@larseggert larseggert marked this pull request as ready for review March 14, 2026 17:51
Copilot AI review requested due to automatic review settings March 14, 2026 17:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Enables Quinn’s Apple “fast UDP datapath” support across the workspace and adds runtime plumbing so consumers (notably Gecko) can opt-in to sendmsg_x/recvmsg_x, while neqo-bin enables it unconditionally as a canary.

Changes:

  • Enable quinn-udp/fast-apple-datapath at the workspace dependency level and remove per-crate feature wiring.
  • Add an Apple-only, process-wide runtime flag in neqo-udp to opt sockets into the fast datapath at creation time.
  • Add cfg(apple) aliasing to neqo-bin and unconditionally enable the fast datapath in the CLI socket setup (plus clippy suppression for Apple builds).

Reviewed changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
neqo-udp/src/lib.rs Adds runtime enablement flag + Apple socket setup hook; adjusts Apple receive buffer strategy.
neqo-udp/Cargo.toml Switches cfg_aliases build-dep to workspace and removes the crate-level fast-path feature.
neqo-bin/src/udp.rs Enables Apple fast datapath unconditionally for CLI sockets.
neqo-bin/src/bin/client.rs Adds Apple-only clippy suppression for large_futures.
neqo-bin/build.rs Introduces cfg(apple) alias for consistent platform gating.
neqo-bin/Cargo.toml Adds cfg_aliases build-dependency; removes fast-path feature.
Cargo.toml Enables quinn-udp’s fast-apple-datapath feature for the whole workspace and adds cfg_aliases to workspace deps.
Cargo.lock Records updated dependency graph including cfg_aliases for neqo-bin.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread neqo-udp/src/lib.rs
Comment thread neqo-bin/src/udp.rs Outdated
Comment thread neqo-bin/src/udp.rs Outdated
@larseggert larseggert force-pushed the feat-apple-fast-datapath branch from 2fd6e8d to 6be99fa Compare March 15, 2026 02:03
Unconditionally in neqo-bin, but with plumbing so Gecko can probe and enable it conditionally.
@larseggert larseggert force-pushed the feat-apple-fast-datapath branch from 6be99fa to f910d92 Compare March 15, 2026 02:22
@larseggert
Copy link
Copy Markdown
Collaborator Author

The Gecko side of this is here: https://github.com/mozilla-firefox/firefox/compare/main...larseggert:firefox:feat-apple-probe-fast?expand=1
Still includes vendoring from a custom branch, which would obviously go away.

Comment thread neqo-bin/src/client/mod.rs Outdated
Comment thread neqo-udp/src/lib.rs Outdated
@larseggert
Copy link
Copy Markdown
Collaborator Author

@mxinden thanks, both good suggestions. I think I confused myself between the neqo and Gecko patches...

@larseggert larseggert requested a review from mxinden March 18, 2026 14:08
@github-actions
Copy link
Copy Markdown
Contributor

Failed Interop Tests

QUIC Interop Runner, client vs. server, differences relative to main at 4288d22.

neqo-pr as clientneqo-pr as server
neqo-pr vs. go-x-net: BP BA
neqo-pr vs. haproxy: BP BA
neqo-pr vs. kwik: S L1 C1 BP BA
neqo-pr vs. linuxquic: ⚠️L1
neqo-pr vs. lsquic: L1 C1
neqo-pr vs. msquic: A L1 C1 ⚠️C2
neqo-pr vs. mvfst: H DC LR M R Z 3 B U A L1 L2 C1 C2 6 BP BA
neqo-pr vs. neqo: Z A
neqo-pr vs. nginx: BP BA
neqo-pr vs. ngtcp2: CM
neqo-pr vs. picoquic: A 🚀BP
neqo-pr vs. quic-go: A
neqo-pr vs. quiche: BP BA
neqo-pr vs. s2n-quic: BA CM
neqo-pr vs. tquic: S BP BA
neqo-pr vs. xquic: A ⚠️C1
aioquic vs. neqo-pr: Z CM
go-x-net vs. neqo-pr: CM
kwik vs. neqo-pr: Z BP BA CM
linuxquic vs. neqo-pr: ⚠️BP BA
lsquic vs. neqo-pr: Z
msquic vs. neqo-pr: Z ⚠️L1 CM
mvfst vs. neqo-pr: Z A L1 C1 CM
neqo vs. neqo-pr: Z A
openssl vs. neqo-pr: LR M A CM
picoquic vs. neqo-pr: Z
quic-go vs. neqo-pr: 🚀BA CM
quiche vs. neqo-pr: Z ⚠️L1 CM
quinn vs. neqo-pr: Z ⚠️L1 V2 CM
s2n-quic vs. neqo-pr: CM
tquic vs. neqo-pr: Z CM
xquic vs. neqo-pr: M CM
All results

Succeeded Interop Tests

QUIC Interop Runner, client vs. server

neqo-pr as client

neqo-pr as server

Unsupported Interop Tests

QUIC Interop Runner, client vs. server

neqo-pr as client

neqo-pr as server

@github-actions
Copy link
Copy Markdown
Contributor

Client/server transfer results

Performance differences relative to 4288d22.

Transfer of 33554432 bytes over loopback, min. 100 runs. All unit-less numbers are in milliseconds.

Client vs. server (params) Mean ± σ Min Max MiB/s ± σ Δ baseline Δ baseline
neqo-neqo-cubic 94.5 ± 4.1 86.5 103.2 338.7 ± 7.8 💚 -1.3 -1.3%
neqo-neqo-cubic-nopacing 93.4 ± 3.7 84.6 101.9 342.5 ± 8.6 💚 -2.4 -2.5%
neqo-neqo-newreno 94.5 ± 3.6 87.3 101.6 338.5 ± 8.9 💚 -1.2 -1.2%
neqo-quiche-cubic 191.5 ± 4.3 185.0 204.0 167.1 ± 7.4 💚 -1.9 -1.0%
neqo-s2n-cubic 221.0 ± 3.7 212.8 229.3 144.8 ± 8.6 💔 3.8 1.7%
quiche-neqo-cubic 183.8 ± 7.6 172.7 220.6 174.1 ± 4.2 💔 4.2 2.3%

Table above only shows statistically significant changes. See all results below.

All results

Transfer of 33554432 bytes over loopback, min. 100 runs. All unit-less numbers are in milliseconds.

Client vs. server (params) Mean ± σ Min Max MiB/s ± σ Δ baseline Δ baseline
google-google-nopacing 453.1 ± 4.1 445.9 466.7 70.6 ± 7.8
google-neqo-cubic 270.1 ± 4.3 261.0 277.8 118.5 ± 7.4 1.2 0.4%
msquic-msquic-nopacing 194.7 ± 99.8 117.5 551.7 164.4 ± 0.3
msquic-neqo-cubic 197.3 ± 82.4 127.5 537.8 162.2 ± 0.4 -18.3 -8.5%
neqo-google-cubic 751.6 ± 4.9 743.5 770.6 42.6 ± 6.5 -0.1 -0.0%
neqo-msquic-cubic 153.4 ± 4.4 145.9 161.2 208.7 ± 7.3 -1.0 -0.6%
neqo-neqo-cubic 94.5 ± 4.1 86.5 103.2 338.7 ± 7.8 💚 -1.3 -1.3%
neqo-neqo-cubic-nopacing 93.4 ± 3.7 84.6 101.9 342.5 ± 8.6 💚 -2.4 -2.5%
neqo-neqo-newreno 94.5 ± 3.6 87.3 101.6 338.5 ± 8.9 💚 -1.2 -1.2%
neqo-neqo-newreno-nopacing 95.8 ± 4.8 87.5 105.6 333.9 ± 6.7 -0.2 -0.2%
neqo-quiche-cubic 191.5 ± 4.3 185.0 204.0 167.1 ± 7.4 💚 -1.9 -1.0%
neqo-s2n-cubic 221.0 ± 3.7 212.8 229.3 144.8 ± 8.6 💔 3.8 1.7%
quiche-neqo-cubic 183.8 ± 7.6 172.7 220.6 174.1 ± 4.2 💔 4.2 2.3%
quiche-quiche-nopacing 142.1 ± 4.3 135.3 156.4 225.2 ± 7.4
s2n-neqo-cubic 222.2 ± 4.6 213.8 239.3 144.0 ± 7.0 0.5 0.2%
s2n-s2n-nopacing 298.7 ± 31.0 279.3 394.5 107.1 ± 1.0

Download data for profiler.firefox.com or download performance comparison data.

@github-actions
Copy link
Copy Markdown
Contributor

Benchmark results

Significant performance differences relative to 4288d22.

transfer/1-conn/1-100mb-resp (aka. Download)/mtu-1504: 💚 Performance has improved by -2.0606%.
       time:   [198.33 ms 198.74 ms 199.22 ms]
       thrpt:  [501.96 MiB/s 503.18 MiB/s 504.22 MiB/s]
change:
       time:   [-2.4011% -2.0606% -1.7069] (p = 0.00 < 0.05)
       thrpt:  [+1.7365% +2.1040% +2.4602]
       Performance has improved.
Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) high mild
1 (1.00%) high severe
transfer/1-conn/10_000-parallel-1b-resp (aka. RPS)/mtu-1504: 💔 Performance has regressed by +2.7600%.
       time:   [289.72 ms 291.60 ms 293.49 ms]
       thrpt:  [34.073 Kelem/s 34.294 Kelem/s 34.516 Kelem/s]
change:
       time:   [+1.8946% +2.7600% +3.6924] (p = 0.00 < 0.05)
       thrpt:  [-3.5609% -2.6859% -1.8594]
       Performance has regressed.
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild
transfer/1-conn/1-100mb-req (aka. Upload)/mtu-1504: 💚 Performance has improved by -1.2540%.
       time:   [201.88 ms 202.26 ms 202.66 ms]
       thrpt:  [493.44 MiB/s 494.41 MiB/s 495.33 MiB/s]
change:
       time:   [-1.5152% -1.2540% -1.0002] (p = 0.00 < 0.05)
       thrpt:  [+1.0103% +1.2699% +1.5386]
       Performance has improved.
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) high mild
All results
transfer/1-conn/1-100mb-resp (aka. Download)/mtu-1504: 💚 Performance has improved by -2.0606%.
       time:   [198.33 ms 198.74 ms 199.22 ms]
       thrpt:  [501.96 MiB/s 503.18 MiB/s 504.22 MiB/s]
change:
       time:   [-2.4011% -2.0606% -1.7069] (p = 0.00 < 0.05)
       thrpt:  [+1.7365% +2.1040% +2.4602]
       Performance has improved.
Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) high mild
1 (1.00%) high severe
transfer/1-conn/10_000-parallel-1b-resp (aka. RPS)/mtu-1504: 💔 Performance has regressed by +2.7600%.
       time:   [289.72 ms 291.60 ms 293.49 ms]
       thrpt:  [34.073 Kelem/s 34.294 Kelem/s 34.516 Kelem/s]
change:
       time:   [+1.8946% +2.7600% +3.6924] (p = 0.00 < 0.05)
       thrpt:  [-3.5609% -2.6859% -1.8594]
       Performance has regressed.
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild
transfer/1-conn/1-1b-resp (aka. HPS)/mtu-1504: No change in performance detected.
       time:   [38.477 ms 38.650 ms 38.841 ms]
       thrpt:  [25.746   B/s 25.873   B/s 25.989   B/s]
change:
       time:   [-0.6576% -0.0257% +0.6295] (p = 0.94 > 0.05)
       thrpt:  [-0.6256% +0.0258% +0.6619]
       No change in performance detected.
Found 9 outliers among 100 measurements (9.00%)
2 (2.00%) high mild
7 (7.00%) high severe
transfer/1-conn/1-100mb-req (aka. Upload)/mtu-1504: 💚 Performance has improved by -1.2540%.
       time:   [201.88 ms 202.26 ms 202.66 ms]
       thrpt:  [493.44 MiB/s 494.41 MiB/s 495.33 MiB/s]
change:
       time:   [-1.5152% -1.2540% -1.0002] (p = 0.00 < 0.05)
       thrpt:  [+1.0103% +1.2699% +1.5386]
       Performance has improved.
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) high mild
streams/walltime/1-streams/each-1000-bytes: No change in performance detected.
       time:   [588.43 µs 592.49 µs 598.15 µs]
       change: [-0.9165% -0.1114% +0.9646] (p = 0.83 > 0.05)
       No change in performance detected.
Found 10 outliers among 100 measurements (10.00%)
10 (10.00%) high severe
streams/walltime/1000-streams/each-1-bytes: Change within noise threshold.
       time:   [12.371 ms 12.390 ms 12.409 ms]
       change: [-0.4910% -0.2644% -0.0694] (p = 0.02 < 0.05)
       Change within noise threshold.
streams/walltime/1000-streams/each-1000-bytes: Change within noise threshold.
       time:   [44.994 ms 45.085 ms 45.220 ms]
       change: [+0.0480% +0.3577% +0.7239] (p = 0.02 < 0.05)
       Change within noise threshold.
Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) high mild
1 (1.00%) high severe
transfer/walltime/pacing-false/varying-seeds: Change within noise threshold.
       time:   [77.627 ms 77.687 ms 77.755 ms]
       change: [-3.0059% -2.8235% -2.6458] (p = 0.00 < 0.05)
       Change within noise threshold.
Found 6 outliers among 100 measurements (6.00%)
1 (1.00%) low mild
4 (4.00%) high mild
1 (1.00%) high severe
transfer/walltime/pacing-true/varying-seeds: Change within noise threshold.
       time:   [79.386 ms 79.487 ms 79.631 ms]
       change: [+0.0492% +0.2951% +0.5262] (p = 0.01 < 0.05)
       Change within noise threshold.
Found 3 outliers among 100 measurements (3.00%)
3 (3.00%) high severe
transfer/walltime/pacing-false/same-seed: Change within noise threshold.
       time:   [77.597 ms 77.696 ms 77.845 ms]
       change: [-2.6578% -2.4391% -2.2208] (p = 0.00 < 0.05)
       Change within noise threshold.
Found 3 outliers among 100 measurements (3.00%)
2 (2.00%) high mild
1 (1.00%) high severe
transfer/walltime/pacing-true/same-seed: Change within noise threshold.
       time:   [79.298 ms 79.394 ms 79.537 ms]
       change: [-0.3209% -0.1706% +0.0131] (p = 0.04 < 0.05)
       Change within noise threshold.
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high severe

Download data for profiler.firefox.com or download performance comparison data.

@mxinden mxinden added this pull request to the merge queue Mar 30, 2026
Merged via the queue into mozilla:main with commit 3d18432 Mar 30, 2026
177 of 179 checks passed
@larseggert larseggert deleted the feat-apple-fast-datapath branch March 30, 2026 10:38
@omansfeld
Copy link
Copy Markdown
Collaborator

The Gecko side of this is here: https://github.com/mozilla-firefox/firefox/compare/main...larseggert:firefox:feat-apple-probe-fast?expand=1 Still includes vendoring from a custom branch, which would obviously go away.

@larseggert FYI v0.25.0 is in Firefox now, so you can land your patch for the Gecko side enabling this!

https://bugzilla.mozilla.org/show_bug.cgi?id=2027632

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.

4 participants