Skip to content

bench: time steady-state write_frames in send_streams - #4409

Open
larseggert wants to merge 2 commits into
mainfrom
bench-send-streams-steady-state
Open

larseggert wants to merge 2 commits into
mainfrom
bench-send-streams-steady-state

Conversation

@larseggert

Copy link
Copy Markdown
Collaborator

Time a send on a stream that already has data in flight, as on a long-lived stream, rather than its first send.

@larseggert
larseggert marked this pull request as ready for review November 23, 2026 15:20
Copilot AI balanced review requested due to automatic review settings November 23, 2026 15:20
@codecov

codecov Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.62%. Comparing base (6ae0599) to head (0497143).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4409   +/-   ##
=======================================
  Coverage   96.61%   96.62%           
=======================================
  Files         118      118           
  Lines       43894    43894           
  Branches    43894    43894           
=======================================
+ Hits        42410    42411    +1     
+ Misses       1463     1462    -1     
  Partials       21       21           
Flag Coverage Δ
freebsd 84.03% <ø> (+0.24%) ⬆️
linux 96.77% <ø> (ø)
windows 94.55% <ø> (-0.01%) ⬇️

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

Components Coverage Δ
neqo-common 99.29% <ø> (ø)
neqo-http3 96.00% <ø> (ø)
neqo-qpack 96.55% <ø> (ø)
neqo-transport 97.13% <ø> (ø)
neqo-udp 87.63% <ø> (ø)
mtu 91.31% <ø> (ø)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The benchmark’s single warm-up packet cannot drain all 4000 initial bytes, leaving untouched streams to perform first-send range allocation during the timed pass instead of measuring steady-state sends.

1 open issue
What changed in this PR

This PR updates the transport send-stream benchmarks to target steady-state write_frames performance, with data already in flight rather than measuring a stream’s first send.

Changes:

  • Adds an untimed warm-up helper that sends queued data and queues another payload.
  • Applies warm-up to regular, fair, grouped, and send-ordered stream setups.
File Description
neqo-transport/​benches/​send_streams.rs Adds shared stream-ID and warm-up helpers for steady-state benchmark setup.

Review effort: Balanced

Comment thread neqo-transport/benches/send_streams.rs Outdated
Comment on lines +66 to +72
/// Sends the queued data once, untimed, and queues `DATA` again on the `active` streams. The timed
/// call then extends each stream's sent range, as on a long-lived stream, rather than allocating
/// the first one.
fn steady_state<I: IntoIterator<Item = StreamId>>(ss: SendStreams, active: I) -> SendStreams {
let mut input = with_builder(ss);
do_write_frames(&mut input);
let mut ss = input.0;

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No whole-change observations.

Comment thread neqo-transport/benches/send_streams.rs Outdated
/// the first one.
fn steady_state<I: IntoIterator<Item = StreamId>>(ss: SendStreams, active: I) -> SendStreams {
let mut input = with_builder(ss);
do_write_frames(&mut input);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

In 20-fair-streams all-active, the warm-up pass cannot drain all streams. The timed call is then not steady state.

packet::LIMIT is 2048 bytes and each STREAM frame is about 204 bytes, so the warm-up sends only about 9 of the 20 streams. The timed call resumes at fair_rr_next, on streams that have never sent and now hold 400 bytes. It allocates first sent ranges, which is what this change wants to keep out of the timing. Loop do_write_frames with fresh builders until no stream has data, then re-queue.

@github-actions

Copy link
Copy Markdown
Contributor

Failed Interop Tests

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

neqo-pr as clientneqo-pr as server
neqo-pr vs. go-x-net: run cancelled after 20 min
neqo-pr vs. haproxy: BP BA
neqo-pr vs. kwik: run cancelled after 20 min
neqo-pr vs. linuxquic: run cancelled after 20 min
neqo-pr vs. lsquic: run cancelled after 20 min
neqo-pr vs. msquic: run cancelled after 20 min
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: run cancelled after 20 min
neqo-pr vs. nginx: BP BA
neqo-pr vs. ngtcp2: Z L1 CM
neqo-pr vs. picoquic: A BP BA
neqo-pr vs. quic-go: run cancelled after 20 min
neqo-pr vs. quiche: run cancelled after 20 min
neqo-pr vs. quinn: run cancelled after 20 min
neqo-pr vs. rama: baseline result missing
neqo-pr vs. s2n-quic: run cancelled after 20 min
neqo-pr vs. tquic: run cancelled after 20 min
neqo-pr vs. xquic: baseline result missing
aioquic vs. neqo-pr: baseline result missing
go-x-net vs. neqo-pr: CM
kwik vs. neqo-pr: CM
linuxquic vs. neqo-pr: run cancelled after 20 min
msquic vs. neqo-pr: run cancelled after 20 min
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: A
openssl vs. neqo-pr: run cancelled after 20 min
quic-go vs. neqo-pr: CM
quic-zig vs. neqo-pr: run cancelled after 20 min
quiche vs. neqo-pr: run cancelled after 20 min
quinn vs. neqo-pr: run cancelled after 20 min
s2n-quic vs. neqo-pr: 🚀BA CM
tquic vs. neqo-pr: run cancelled after 20 min
xquic vs. neqo-pr: run cancelled after 20 min
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

@codspeed

codspeed Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will regress 7 benchmarks

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

⚡ 6 improved benchmarks
❌ 7 regressed benchmarks
✅ 88 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ CPU Simulation write_frames 5-fair-streams all-active 13.1 µs 14.3 µs -8.27%
❌ CPU Simulation write_frames 1-stream 7.6 µs 8.2 µs -8.14%
❌ CPU Simulation write_frames 5-streams 1-active 8.1 µs 8.8 µs -7.02%
❌ CPU Simulation write_frames 20-streams 1-active 10.4 µs 11 µs -5.62%
❌ Walltime walltime/pacing-true/varying-seeds 3.8 ms 3.9 ms -4.16%
❌ Walltime quiche-neqo 47 ms 48.4 ms -2.98%
❌ Walltime walltime/pacing-false/varying-seeds 3.3 ms 3.4 ms -2.39%
⚡ Memory write_frames 20-fair-streams all-active 3.5 KB 1.6 KB ×2.1
⚡ CPU Simulation write_frames 20-fair-streams all-active 28 µs 19.7 µs +41.81%
⚡ CPU Simulation write_frames 3-groups 9-streams all-active 25 µs 22.7 µs +9.86%
⚡ Walltime walltime/pacing-false/same-seed 3.4 ms 3.2 ms +5.47%
⚡ Walltime walltime/pacing-true/same-seed 4 ms 3.9 ms +4.32%
⚡ Walltime neqo-s2n 59.8 ms 58.5 ms +2.36%

Tip

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


Comparing bench-send-streams-steady-state (9c38019) with main (c46d346)

Open in CodSpeed

@github-actions

Copy link
Copy Markdown
Contributor

Client/server transfer results

Performance differences relative to c46d346.

No significant performance differences.

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 158.3 ± 0.5 157.3 – 159.7 158.3 ± 0.5 202.1 ± 0.6
google-neqo-cubic 80.5 ± 0.4 79.7 – 81.3 80.5 ± 0.3 397.6 ± 1.7 +0.4 (+0.5%)
neqo-google-cubic ⚠️ 240.8 ± 39.3 202.2 – 323.0 210.7 ± 10.7 132.9 ± 21.7 +0.6 (+0.3%)
neqo-neqo-cubic 23.9 ± 0.2 23.6 – 24.4 23.8 ± 0.2 1339.1 ± 9.9 -0.1 (-0.3%)
neqo-neqo-cubic-nopacing 23.4 ± 0.1 23.1 – 23.8 23.4 ± 0.1 1368.7 ± 7.4 +0.0 (+0.0%)
neqo-neqo-newreno 24.0 ± 0.2 23.6 – 24.6 24.0 ± 0.2 1332.5 ± 10.9 +0.1 (+0.4%)
neqo-neqo-newreno-nopacing 23.3 ± 0.1 23.1 – 24.0 23.3 ± 0.1 1373.5 ± 8.0 -0.1 (-0.2%)
neqo-quiche-cubic 35.0 ± 0.3 34.4 – 35.9 35.0 ± 0.3 913.5 ± 8.5 +0.2 (+0.5%)
neqo-s2n-cubic 45.5 ± 0.2 45.0 – 46.0 45.5 ± 0.2 703.9 ± 3.4 +0.0 (+0.1%)
quiche-neqo-cubic 36.4 ± 0.5 35.5 – 38.2 36.3 ± 0.3 879.9 ± 12.0 -0.1 (-0.4%)
quiche-quiche 43.0 ± 0.3 42.4 – 44.0 43.0 ± 0.3 743.6 ± 5.5
s2n-neqo-cubic 127.9 ± 0.6 126.7 – 129.4 127.8 ± 0.4 250.1 ± 1.1 +0.1 (+0.1%)
s2n-s2n ⚠️ 181.5 ± 27.9 149.8 – 273.0 172.1 ± 1.8 176.3 ± 27.1

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

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark results

No significant performance differences relative to c46d346.

All results
transfer/1-conn/1-100mb-req (aka. Upload)/mtu-1500
       time:   [61.103 ms 61.145 ms 61.187 ms]
       thrpt:  [1.5960 GiB/s 1.5971 GiB/s 1.5982 GiB/s]
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) high mild
transfer/1-conn/1-100mb-resp (aka. Download)/mtu-1500
       time:   [61.966 ms 62.017 ms 62.068 ms]
       thrpt:  [1.5734 GiB/s 1.5747 GiB/s 1.5760 GiB/s]
transfer/1-conn/1-1b-resp (aka. HPS)/mtu-1500
       time:   [3.8069 ms 3.8080 ms 3.8090 ms]
       thrpt:  [262.54   B/s 262.61   B/s 262.68   B/s]
Found 6 outliers among 100 measurements (6.00%)
5 (5.00%) high mild
1 (1.00%) high severe
transfer/1-conn/10_000-parallel-1b-resp (aka. RPS)/mtu-1500
       time:   [88.197 ms 88.356 ms 88.512 ms]
       thrpt:  [112.98 Kelem/s 113.18 Kelem/s 113.38 Kelem/s]
streams-flow-controlled/walltime/1-streams/each-4194304-bytes
       time:   [13.117 ms 13.124 ms 13.130 ms]
       thrpt:  [304.64 MiB/s 304.78 MiB/s 304.94 MiB/s]
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) low severe
streams-flow-controlled/walltime/10-streams/each-1048576-bytes
       time:   [35.993 ms 36.045 ms 36.094 ms]
       thrpt:  [277.05 MiB/s 277.43 MiB/s 277.83 MiB/s]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) low mild
streams/walltime/1-streams/each-1000-bytes
       time:   [161.77 µs 162.45 µs 163.32 µs]
       thrpt:  [5.8392 MiB/s 5.8707 MiB/s 5.8953 MiB/s]
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) high mild
streams/walltime/1000-streams/each-1-bytes
       time:   [4.7825 ms 4.7844 ms 4.7863 ms]
       thrpt:  [204.03 KiB/s 204.11 KiB/s 204.20 KiB/s]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) low mild
streams/walltime/1000-streams/each-1000-bytes
       time:   [15.291 ms 15.297 ms 15.302 ms]
       thrpt:  [62.323 MiB/s 62.345 MiB/s 62.367 MiB/s]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild
transfer/walltime/pacing-false/same-seed
       time:   [3.4490 ms 3.4503 ms 3.4518 ms]
       thrpt:  [1.1316 GiB/s 1.1322 GiB/s 1.1326 GiB/s]
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) high mild
transfer/walltime/pacing-false/varying-seeds
       time:   [3.2065 ms 3.2075 ms 3.2088 ms]
       thrpt:  [1.2174 GiB/s 1.2178 GiB/s 1.2182 GiB/s]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high severe
transfer/walltime/pacing-true/same-seed
       time:   [4.0477 ms 4.0492 ms 4.0511 ms]
       thrpt:  [987.39 MiB/s 987.85 MiB/s 988.23 MiB/s]
transfer/walltime/pacing-true/varying-seeds
       time:   [3.9127 ms 3.9149 ms 3.9176 ms]
       thrpt:  [1021.0 MiB/s 1021.7 MiB/s 1022.3 MiB/s]

Instructions per cycle

Criterion reported no significant timing changes.

All benchmarks
Benchmark IPC before IPC after ΔIPC
transfer/walltime/pacing-true/same-seed 2.86 2.88 +0.8%
transfer/1-conn/10_000-parallel-1b-resp (aka. RPS)/mtu-1500 3.21 3.18 -0.8%
transfer/walltime/pacing-false/varying-seeds 2.85 2.83 -0.6%
streams-flow-controlled/walltime/1-streams/each-4194304-bytes 2.96 2.95 -0.4%
transfer/walltime/pacing-false/same-seed 2.87 2.86 -0.3%
transfer/walltime/pacing-true/varying-seeds 2.86 2.87 +0.3%
streams-flow-controlled/walltime/10-streams/each-1048576-bytes 3.11 3.12 +0.2%
transfer/1-conn/1-100mb-resp (aka. Download)/mtu-1500 3.08 3.09 +0.1%
streams/walltime/1-streams/each-1000-bytes 2.56 2.56 +0.1%
transfer/1-conn/1-100mb-req (aka. Upload)/mtu-1500 3.08 3.08 -0.1%
transfer/1-conn/1-1b-resp (aka. HPS)/mtu-1500 2.25 2.25 +0.0%
streams/walltime/1000-streams/each-1000-bytes 2.95 2.95 -0.0%
streams/walltime/1000-streams/each-1-bytes 3.28 3.28 +0.0%
Profiles for profiler.firefox.com (64)

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

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No findings.

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