Skip to content

bench: build the decoder buffer once - #4413

Open
larseggert wants to merge 1 commit into
mainfrom
bench-decoder-buffer
Open

larseggert wants to merge 1 commit into
mainfrom
bench-decoder-buffer

Conversation

@larseggert

Copy link
Copy Markdown
Collaborator

Decoding only reads the buffer, so build it once rather than per iteration.

@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

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.

🟢 Approval recommended

The decoder benchmark’s input-buffer reuse change has no active review issues.

No open issues 🎉

What changed in this PR

Updates the neqo-common decoder benchmark to reuse its read-only input buffer instead of rebuilding it for each iteration.

Changes:

  • Builds the buffer once before registering the benchmark.
  • Replaces batched iteration with b.iter, creating a fresh decoder each time and passing the input through black_box.
File Description
neqo-common/​benches/​decoder.rs Reuses the input buffer and simplifies the decoder benchmark loop.

Review effort: Balanced

@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.60%. Comparing base (6ae0599) to head (4be60fd).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4413      +/-   ##
==========================================
- Coverage   96.61%   96.60%   -0.02%     
==========================================
  Files         118      118              
  Lines       43894    43894              
  Branches    43894    43894              
==========================================
- Hits        42410    42405       -5     
- Misses       1463     1468       +5     
  Partials       21       21              
Flag Coverage Δ
freebsd 94.12% <ø> (+10.33%) ⬆️
linux 96.76% <ø> (-0.02%) ⬇️
macos 94.50% <ø> (-0.01%) ⬇️
windows 94.56% <ø> (ø)

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

Components Coverage Δ
neqo-common 99.33% <ø> (+0.04%) ⬆️
neqo-http3 96.00% <ø> (ø)
neqo-qpack 96.55% <ø> (ø)
neqo-transport 97.10% <ø> (-0.03%) ⬇️
neqo-udp 87.63% <ø> (ø)
mtu 91.31% <ø> (ø)

@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.

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

@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 155.6 ± 0.6 154.5 – 157.5 155.5 ± 0.5 205.6 ± 0.8
google-neqo-cubic 79.8 ± 0.4 78.8 – 80.9 79.8 ± 0.4 401.1 ± 2.0 +0.7 (+0.9%)
neqo-google-cubic 253.8 ± 36.3 194.9 – 316.0 255.2 ± 49.0 126.1 ± 18.0 +4.6 (+1.8%)
neqo-neqo-cubic 23.9 ± 0.2 23.6 – 24.3 23.9 ± 0.1 1337.9 ± 9.0 -0.1 (-0.3%)
neqo-neqo-cubic-nopacing 23.6 ± 0.1 23.4 – 24.2 23.6 ± 0.1 1355.8 ± 6.7 +0.1 (+0.6%)
neqo-neqo-newreno 24.0 ± 0.2 23.6 – 24.6 23.9 ± 0.2 1335.3 ± 10.0 +0.0 (+0.1%)
neqo-neqo-newreno-nopacing 23.3 ± 0.1 23.1 – 23.8 23.3 ± 0.1 1372.5 ± 8.4 +0.0 (+0.1%)
neqo-quiche-cubic 35.3 ± 0.3 34.8 – 36.3 35.2 ± 0.2 907.7 ± 7.2 -0.1 (-0.2%)
neqo-s2n-cubic 45.3 ± 0.2 44.8 – 45.9 45.3 ± 0.3 707.2 ± 3.8 +0.0 (+0.0%)
quiche-neqo-cubic 36.3 ± 0.4 35.3 – 37.4 36.4 ± 0.4 881.0 ± 10.6 -0.1 (-0.2%)
quiche-quiche 42.7 ± 0.3 42.0 – 43.8 42.7 ± 0.3 749.1 ± 4.9
s2n-neqo-cubic 125.8 ± 0.4 124.7 – 126.8 125.8 ± 0.4 254.3 ± 0.9 +0.1 (+0.1%)
s2n-s2n ⚠️ 175.4 ± 27.5 145.3 – 269.3 169.4 ± 1.1 182.5 ± 28.6

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

@codspeed

codspeed Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will regress 4 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

⚡ 8 improved benchmarks
❌ 4 regressed benchmarks
✅ 89 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Walltime walltime/pacing-false/same-seed 3.4 ms 3.6 ms -6.3%
❌ Walltime walltime/pacing-true/same-seed 4 ms 4.2 ms -3.87%
❌ Walltime neqo-neqo-cubic 25.5 ms 26.2 ms -2.86%
❌ Walltime 1-conn/10_000-parallel-1b-resp (aka. RPS) 87.2 ms 89.2 ms -2.23%
⚡ Walltime neqo-s2n 59.8 ms 57.8 ms +3.51%
⚡ CPU Simulation decode 1048576 bytes, mask 3f 10.7 ms 10.4 ms +3.13%
⚡ CPU Simulation decode 4096 bytes, mask 3f 42.2 µs 41 µs +3.09%
⚡ Walltime quiche-neqo 47 ms 45.7 ms +2.84%
⚡ CPU Simulation decode 1048576 bytes, mask 7f 9 ms 8.7 ms +2.77%
⚡ CPU Simulation decode 4096 bytes, mask 7f 35.5 µs 34.5 µs +2.72%
⚡ CPU Simulation decode 1048576 bytes, mask ff 6.2 ms 6 ms +2.52%
⚡ CPU Simulation decode 4096 bytes, mask ff 24.6 µs 24 µs +2.45%

Tip

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


Comparing bench-decoder-buffer (4be60fd) with main (c46d346)

Open in CodSpeed

@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:   [62.193 ms 62.233 ms 62.273 ms]
       thrpt:  [1.5682 GiB/s 1.5692 GiB/s 1.5702 GiB/s]
Found 4 outliers among 100 measurements (4.00%)
3 (3.00%) low mild
1 (1.00%) high mild
transfer/1-conn/1-100mb-resp (aka. Download)/mtu-1500
       time:   [61.432 ms 61.489 ms 61.549 ms]
       thrpt:  [1.5867 GiB/s 1.5882 GiB/s 1.5897 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.8081 ms 3.8089 ms 3.8097 ms]
       thrpt:  [262.49   B/s 262.54   B/s 262.60   B/s]
Found 4 outliers among 100 measurements (4.00%)
1 (1.00%) low mild
3 (3.00%) high severe
transfer/1-conn/10_000-parallel-1b-resp (aka. RPS)/mtu-1500
       time:   [87.433 ms 87.578 ms 87.723 ms]
       thrpt:  [114.00 Kelem/s 114.18 Kelem/s 114.37 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:   [13.045 ms 13.064 ms 13.082 ms]
       thrpt:  [305.77 MiB/s 306.19 MiB/s 306.63 MiB/s]
Found 23 outliers among 100 measurements (23.00%)
21 (21.00%) low severe
1 (1.00%) low mild
1 (1.00%) high mild
streams-flow-controlled/walltime/10-streams/each-1048576-bytes
       time:   [35.952 ms 35.998 ms 36.042 ms]
       thrpt:  [277.45 MiB/s 277.79 MiB/s 278.15 MiB/s]
Found 17 outliers among 100 measurements (17.00%)
1 (1.00%) low severe
16 (16.00%) low mild
streams/walltime/1-streams/each-1000-bytes
       time:   [161.66 µs 162.32 µs 163.15 µs]
       thrpt:  [5.8453 MiB/s 5.8754 MiB/s 5.8993 MiB/s]
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) high mild
streams/walltime/1000-streams/each-1-bytes
       time:   [4.7768 ms 4.7788 ms 4.7805 ms]
       thrpt:  [204.28 KiB/s 204.35 KiB/s 204.44 KiB/s]
Found 4 outliers among 100 measurements (4.00%)
3 (3.00%) low severe
1 (1.00%) low mild
streams/walltime/1000-streams/each-1000-bytes
       time:   [15.277 ms 15.283 ms 15.288 ms]
       thrpt:  [62.379 MiB/s 62.402 MiB/s 62.426 MiB/s]
Found 5 outliers among 100 measurements (5.00%)
4 (4.00%) low mild
1 (1.00%) high mild
transfer/walltime/pacing-false/same-seed
       time:   [3.3513 ms 3.3529 ms 3.3549 ms]
       thrpt:  [1.1643 GiB/s 1.1650 GiB/s 1.1656 GiB/s]
transfer/walltime/pacing-false/varying-seeds
       time:   [3.4384 ms 3.4394 ms 3.4407 ms]
       thrpt:  [1.1353 GiB/s 1.1357 GiB/s 1.1361 GiB/s]
Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) low mild
1 (1.00%) high mild
transfer/walltime/pacing-true/same-seed
       time:   [3.8123 ms 3.8148 ms 3.8179 ms]
       thrpt:  [1.0231 GiB/s 1.0240 GiB/s 1.0246 GiB/s]
Found 9 outliers among 100 measurements (9.00%)
9 (9.00%) low mild
transfer/walltime/pacing-true/varying-seeds
       time:   [4.0414 ms 4.0426 ms 4.0441 ms]
       thrpt:  [989.09 MiB/s 989.45 MiB/s 989.75 MiB/s]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild

Instructions per cycle

Criterion reported no significant timing changes.

All benchmarks
Benchmark IPC before IPC after ΔIPC
streams-flow-controlled/walltime/1-streams/each-4194304-bytes 2.93 2.96 +1.1%
streams-flow-controlled/walltime/10-streams/each-1048576-bytes 3.09 3.12 +0.9%
streams/walltime/1000-streams/each-1000-bytes 2.92 2.95 +0.9%
transfer/1-conn/1-1b-resp (aka. HPS)/mtu-1500 2.26 2.24 -0.5%
streams/walltime/1000-streams/each-1-bytes 3.27 3.26 -0.5%
transfer/1-conn/1-100mb-req (aka. Upload)/mtu-1500 3.08 3.07 -0.4%
transfer/walltime/pacing-true/varying-seeds 2.87 2.88 +0.4%
transfer/walltime/pacing-false/varying-seeds 2.86 2.87 +0.3%
transfer/1-conn/10_000-parallel-1b-resp (aka. RPS)/mtu-1500 3.21 3.21 -0.2%
transfer/walltime/pacing-false/same-seed 2.86 2.86 -0.1%
transfer/1-conn/1-100mb-resp (aka. Download)/mtu-1500 3.10 3.11 +0.1%
transfer/walltime/pacing-true/same-seed 2.86 2.86 +0.1%
streams/walltime/1-streams/each-1000-bytes 2.58 2.58 -0.1%
Profiles for profiler.firefox.com (64)

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