Skip to content

refactor(http3): expose connect_udp_set_datagram_max_age methods - #4334

Open
aochagavia wants to merge 1 commit into
mozilla:mainfrom
aochagavia:refactor-max-age
Open

aochagavia wants to merge 1 commit into
mozilla:mainfrom
aochagavia:refactor-max-age

Conversation

@aochagavia

Copy link
Copy Markdown
Collaborator

In the presence of backpressure, the inner connect_udp connection may queue outbound datagrams for a long time. We need a way to set an appropriate datagram max age, because otherwise we may silently drop datagrams.

@codecov

codecov Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.60%. Comparing base (b71bb02) to head (1f2880f).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4334      +/-   ##
==========================================
- Coverage   97.12%   96.60%   -0.52%     
==========================================
  Files         113      118       +5     
  Lines       43301    43709     +408     
  Branches    43301    43709     +408     
==========================================
+ Hits        42054    42224     +170     
- Misses       1231     1464     +233     
- Partials       16       21       +5     
Flag Coverage Δ
freebsd 94.10% <100.00%> (-0.98%) ⬇️
linux 96.75% <100.00%> (-0.42%) ⬇️
macos 94.48% <100.00%> (-0.88%) ⬇️
windows 94.53% <100.00%> (-0.91%) ⬇️

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

Components Coverage Δ
neqo-common 99.33% <ø> (+<0.01%) ⬆️
neqo-http3 95.98% <100.00%> (-0.09%) ⬇️
neqo-qpack 96.55% <ø> (-0.35%) ⬇️
neqo-transport 97.10% <100.00%> (-0.58%) ⬇️
neqo-udp 87.63% <ø> (-2.34%) ⬇️
mtu 91.18% <ø> (-0.41%) ⬇️

@mxinden mxinden left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Instead of making the max-age mechanism configurable, I would prefer us disabling it for all connect-udp sessions for now. I don't see how enabling this mechanism will lead to any meaningful performance improvement in the case of connect-udp. We can later on revisit that decision.

Objections @aochagavia?

In the presence of backpressure, the inner connect_udp connection may
queue outbound datagrams for a long time. We now disable datagram
expiration, because otherwise we may silently drop datagrams.
@aochagavia

Copy link
Copy Markdown
Collaborator Author

Makes lots of sense, thanks! Just pushed an update.

@codspeed

codspeed Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will degrade performance by 0.27%

1 warning

⚠️ 1 benchmark is dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚡ 1 improved benchmark
❌ 3 regressed benchmarks
✅ 97 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ CPU Simulation simulated/pacing-true/same-seed 59.7 ms 61.6 ms -3.01%
❌ Walltime s2n-neqo 135.7 ms 139.7 ms -2.91%
❌ Walltime 1-conn/1-100mb-resp (aka. Download) 59.7 ms 61 ms -2.12%
⚡ Walltime walltime/pacing-false/same-seed 3.6 ms 3.4 ms +7.33%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing aochagavia:refactor-max-age (1f2880f) with main (d95c6bb)

Open in CodSpeed

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark results

No significant performance differences relative to d95c6bb.

All results
transfer/1-conn/1-100mb-req (aka. Upload)/mtu-1500
       time:   [60.014 ms 60.042 ms 60.069 ms]
       thrpt:  [1.6257 GiB/s 1.6265 GiB/s 1.6272 GiB/s]
Found 3 outliers among 100 measurements (3.00%)
1 (1.00%) low mild
2 (2.00%) high mild
transfer/1-conn/1-100mb-resp (aka. Download)/mtu-1500
       time:   [58.624 ms 58.660 ms 58.698 ms]
       thrpt:  [1.6637 GiB/s 1.6648 GiB/s 1.6658 GiB/s]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild
transfer/1-conn/1-1b-resp (aka. HPS)/mtu-1500
       time:   [3.8038 ms 3.8049 ms 3.8059 ms]
       thrpt:  [262.75   B/s 262.82   B/s 262.89   B/s]
Found 3 outliers among 100 measurements (3.00%)
1 (1.00%) low mild
1 (1.00%) high mild
1 (1.00%) high severe
transfer/1-conn/10_000-parallel-1b-resp (aka. RPS)/mtu-1500
       time:   [86.685 ms 86.879 ms 87.076 ms]
       thrpt:  [114.84 Kelem/s 115.10 Kelem/s 115.36 Kelem/s]
Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) low mild
1 (1.00%) high mild
streams-flow-controlled/walltime/1-streams/each-4194304-bytes
       time:   [12.889 ms 12.902 ms 12.915 ms]
       thrpt:  [309.73 MiB/s 310.03 MiB/s 310.33 MiB/s]
streams-flow-controlled/walltime/10-streams/each-1048576-bytes
       time:   [36.063 ms 36.088 ms 36.113 ms]
       thrpt:  [276.91 MiB/s 277.10 MiB/s 277.29 MiB/s]
streams/walltime/1-streams/each-1000-bytes
       time:   [159.54 µs 160.21 µs 161.06 µs]
       thrpt:  [5.9213 MiB/s 5.9527 MiB/s 5.9776 MiB/s]
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) high mild
streams/walltime/1000-streams/each-1-bytes
       time:   [4.7360 ms 4.7379 ms 4.7399 ms]
       thrpt:  [206.03 KiB/s 206.12 KiB/s 206.20 KiB/s]
streams/walltime/1000-streams/each-1000-bytes
       time:   [15.277 ms 15.292 ms 15.307 ms]
       thrpt:  [62.301 MiB/s 62.363 MiB/s 62.426 MiB/s]
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) high mild
transfer/walltime/pacing-false/same-seed
       time:   [3.4880 ms 3.4896 ms 3.4914 ms]
       thrpt:  [1.1188 GiB/s 1.1194 GiB/s 1.1199 GiB/s]
transfer/walltime/pacing-false/varying-seeds
       time:   [3.4630 ms 3.4641 ms 3.4655 ms]
       thrpt:  [1.1272 GiB/s 1.1276 GiB/s 1.1280 GiB/s]
transfer/walltime/pacing-true/same-seed
       time:   [4.1852 ms 4.1870 ms 4.1892 ms]
       thrpt:  [954.83 MiB/s 955.34 MiB/s 955.75 MiB/s]
transfer/walltime/pacing-true/varying-seeds
       time:   [4.1457 ms 4.1479 ms 4.1504 ms]
       thrpt:  [963.76 MiB/s 964.35 MiB/s 964.85 MiB/s]

Instructions per cycle

Criterion reported no significant timing changes.

All benchmarks
Benchmark IPC before IPC after ΔIPC
streams-flow-controlled/walltime/10-streams/each-1048576-bytes 3.10 3.08 -0.8%
transfer/walltime/pacing-true/varying-seeds 2.88 2.91 +0.8%
transfer/walltime/pacing-false/varying-seeds 2.88 2.86 -0.7%
transfer/walltime/pacing-false/same-seed 2.88 2.86 -0.6%
streams/walltime/1000-streams/each-1000-bytes 2.94 2.96 +0.5%
transfer/1-conn/10_000-parallel-1b-resp (aka. RPS)/mtu-1500 3.23 3.25 +0.4%
streams/walltime/1000-streams/each-1-bytes 3.26 3.28 +0.4%
transfer/1-conn/1-100mb-req (aka. Upload)/mtu-1500 3.10 3.11 +0.3%
transfer/1-conn/1-1b-resp (aka. HPS)/mtu-1500 2.26 2.25 -0.3%
transfer/walltime/pacing-true/same-seed 2.87 2.86 -0.2%
transfer/1-conn/1-100mb-resp (aka. Download)/mtu-1500 3.16 3.17 +0.2%
streams/walltime/1-streams/each-1000-bytes 2.57 2.57 +0.1%
streams-flow-controlled/walltime/1-streams/each-4194304-bytes 2.96 2.96 -0.0%
Profiles for profiler.firefox.com (64)

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

@github-actions

Copy link
Copy Markdown
Contributor

Failed Interop Tests

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

neqo-pr as clientneqo-pr as server
neqo-pr vs. aioquic: run cancelled after 20 min
neqo-pr vs. go-x-net: BP BA
neqo-pr vs. haproxy: BP BA
neqo-pr vs. kwik: 🚀B ⚠️R L1 C1 🚀C2 BP ⚠️BA
neqo-pr vs. linuxquic: CM
neqo-pr vs. lsquic: L1 C1
neqo-pr vs. msquic: baseline result missing
neqo-pr vs. mvfst: H DC LR C20 M S R Z 3 B U E A L1 L2 C1 C2 6 V2 BP BA CM
neqo-pr vs. neqo: A
neqo-pr vs. nginx: BP BA
neqo-pr vs. ngtcp2: Z L1 ⚠️C1 CM
neqo-pr vs. picoquic: A ⚠️BP BA
neqo-pr vs. quic-go: A
neqo-pr vs. quiche: baseline result missing
neqo-pr vs. s2n-quic: CM
neqo-pr vs. tquic: run cancelled after 20 min
neqo-pr vs. xquic: S R Z A L1 C1
aioquic vs. neqo-pr: baseline result missing
go-x-net vs. neqo-pr: CM
kwik vs. neqo-pr: BP BA CM
msquic vs. neqo-pr: CM
mvfst vs. neqo-pr: H DC LR C20 M S R Z 3 B U E A L1 L2 C1 C2 6 V2 BP BA CM
neqo vs. neqo-pr: baseline result missing
openssl vs. neqo-pr: LR M A CM
quic-go vs. neqo-pr: CM
quic-zig vs. neqo-pr: CM
quiche vs. neqo-pr: CM
quinn vs. neqo-pr: V2 CM
s2n-quic vs. neqo-pr: 🚀BP ⚠️BA CM
tquic vs. neqo-pr: run cancelled after 20 min
xquic vs. neqo-pr: baseline result missing
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 d95c6bb.

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

Client vs. server Mean±σ Min–Max Median±MAD MiB/s±σ ΔMedian
neqo-google-cubic ⚠️ 235.5 ± 38.2 203.0 – 310.6 208.2 ± 3.3 135.9 ± 22.1 💚 -13.9 (-6.3%)
neqo-neqo-cubic 23.9 ± 0.2 23.5 – 24.5 23.9 ± 0.1 1337.9 ± 9.7 💚 -0.4 (-1.8%)

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 Mean±σ Min–Max Median±MAD MiB/s±σ ΔMedian
google-google 157.5 ± 0.6 156.2 – 159.2 157.5 ± 0.5 203.2 ± 0.8
google-neqo-cubic 81.5 ± 0.4 80.6 – 82.8 81.5 ± 0.4 392.8 ± 2.0 +0.7 (+0.9%)
neqo-google-cubic ⚠️ 235.5 ± 38.2 203.0 – 310.6 208.2 ± 3.3 135.9 ± 22.1 💚 -13.9 (-6.3%)
neqo-neqo-cubic 23.9 ± 0.2 23.5 – 24.5 23.9 ± 0.1 1337.9 ± 9.7 💚 -0.4 (-1.8%)
neqo-neqo-cubic-nopacing 23.5 ± 0.1 23.1 – 24.0 23.4 ± 0.1 1363.7 ± 8.6 +0.0 (+0.1%)
neqo-neqo-newreno 23.9 ± 0.2 23.5 – 24.6 23.9 ± 0.2 1337.8 ± 11.6 +0.1 (+0.2%)
neqo-neqo-newreno-nopacing 23.4 ± 0.1 23.1 – 23.8 23.4 ± 0.1 1366.6 ± 7.3 -0.0 (-0.0%)
neqo-quiche-cubic 34.8 ± 0.4 33.9 – 36.1 34.8 ± 0.4 918.3 ± 11.2 -0.0 (-0.1%)
neqo-s2n-cubic 45.3 ± 0.2 44.8 – 45.8 45.3 ± 0.2 707.0 ± 3.3 -0.0 (-0.1%)
quiche-neqo-cubic 36.5 ± 0.4 35.4 – 37.5 36.5 ± 0.5 875.6 ± 9.9 -0.0 (-0.0%)
quiche-quiche 41.4 ± 0.3 40.8 – 42.2 41.4 ± 0.3 772.4 ± 5.7
s2n-neqo-cubic 128.6 ± 0.6 127.5 – 133.1 128.5 ± 0.5 248.8 ± 1.3 +0.4 (+0.3%)
s2n-s2n ⚠️ 180.2 ± 29.5 146.5 – 272.1 172.1 ± 1.9 177.6 ± 29.1

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

This branch has not been deployed

No deployments
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.

2 participants