Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(transport): have add_datagram take Vec<u8> #2120

Merged
merged 2 commits into from
Sep 18, 2024

Conversation

mxinden
Copy link
Collaborator

@mxinden mxinden commented Sep 16, 2024

add_datagram takes a Quic datagram and adds it to the queue of datagrams to be sent out. Previously it would take a reference (i.e. &[u8]) and would allocate it into a new Vec<u8> before enqueuing. At the call-site the original allocation (referenced by the &[u8]) would go out-of-scope and thus be de-allocated. This is a wasted allocation for each Quic datagram to be send.

This commit has the call-site pass the owned Vec<u8> down right away.

`add_datagram` takes a Quic datagram and adds it to the queue of datagrams to be
sent out. Previously it would take a reference (i.e. `&[u8]`) and would allocate
it into a new `Vec<u8>` before enqueuing. At the call-site the original
allocation (referenced by the `&[u8]`) would go out-of-scope and thus be
de-allocated. This is a wasted allocation for each Quic datagram to be send.

This commit has the call-site pass the owned `Vec<u8>` down right away.
Copy link

codecov bot commented Sep 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.31%. Comparing base (75372c2) to head (d2603d5).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2120      +/-   ##
==========================================
- Coverage   95.32%   95.31%   -0.01%     
==========================================
  Files         112      112              
  Lines       36319    36316       -3     
==========================================
- Hits        34621    34615       -6     
- Misses       1698     1701       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Sep 16, 2024

Failed Interop Tests

QUIC Interop Runner, client vs. server

neqo-latest as client

neqo-latest as server

All results

Succeeded Interop Tests

QUIC Interop Runner, client vs. server

neqo-latest as client

neqo-latest as server

Unsupported Interop Tests

QUIC Interop Runner, client vs. server

neqo-latest as client

neqo-latest as server

Copy link

github-actions bot commented Sep 16, 2024

Benchmark results

Performance differences relative to b780e53.

coalesce_acked_from_zero 1+1 entries: No change in performance detected.
       time:   [99.506 ns 99.840 ns 100.18 ns]
       change: [-0.3972% +0.3129% +0.8999%] (p = 0.38 > 0.05)

Found 13 outliers among 100 measurements (13.00%)
8 (8.00%) high mild
5 (5.00%) high severe

coalesce_acked_from_zero 3+1 entries: No change in performance detected.
       time:   [117.19 ns 117.55 ns 117.94 ns]
       change: [-0.5740% -0.0443% +0.4019%] (p = 0.87 > 0.05)

Found 13 outliers among 100 measurements (13.00%)
1 (1.00%) low mild
1 (1.00%) high mild
11 (11.00%) high severe

coalesce_acked_from_zero 10+1 entries: No change in performance detected.
       time:   [116.78 ns 117.19 ns 117.68 ns]
       change: [-0.6992% -0.1123% +0.4395%] (p = 0.71 > 0.05)

Found 12 outliers among 100 measurements (12.00%)
1 (1.00%) low severe
4 (4.00%) low mild
2 (2.00%) high mild
5 (5.00%) high severe

coalesce_acked_from_zero 1000+1 entries: No change in performance detected.
       time:   [96.989 ns 97.146 ns 97.323 ns]
       change: [-0.8335% -0.0881% +0.7050%] (p = 0.84 > 0.05)

Found 6 outliers among 100 measurements (6.00%)
2 (2.00%) high mild
4 (4.00%) high severe

RxStreamOrderer::inbound_frame(): No change in performance detected.
       time:   [110.97 ms 111.10 ms 111.33 ms]
       change: [-0.0860% +0.1653% +0.4044%] (p = 0.22 > 0.05)

Found 11 outliers among 100 measurements (11.00%)
8 (8.00%) low mild
2 (2.00%) high mild
1 (1.00%) high severe

transfer/pacing-false/varying-seeds: No change in performance detected.
       time:   [25.883 ms 26.792 ms 27.688 ms]
       change: [-6.3449% -1.6427% +3.3262%] (p = 0.50 > 0.05)
transfer/pacing-true/varying-seeds: No change in performance detected.
       time:   [34.175 ms 35.933 ms 37.725 ms]
       change: [-10.937% -4.4610% +2.4717%] (p = 0.20 > 0.05)

Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild

transfer/pacing-false/same-seed: No change in performance detected.
       time:   [31.879 ms 32.563 ms 33.223 ms]
       change: [-1.7419% +1.4026% +4.5902%] (p = 0.38 > 0.05)

Found 3 outliers among 100 measurements (3.00%)
3 (3.00%) low mild

transfer/pacing-true/same-seed: No change in performance detected.
       time:   [37.088 ms 39.936 ms 42.827 ms]
       change: [-15.168% -6.3307% +3.0117%] (p = 0.17 > 0.05)
1-conn/1-100mb-resp (aka. Download)/client: No change in performance detected.
       time:   [113.31 ms 113.69 ms 114.05 ms]
       thrpt:  [876.81 MiB/s 879.60 MiB/s 882.56 MiB/s]
change:
       time:   [-0.5780% -0.1062% +0.3695%] (p = 0.66 > 0.05)
       thrpt:  [-0.3681% +0.1063% +0.5813%]

Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) low severe
1 (1.00%) low mild

1-conn/10_000-parallel-1b-resp (aka. RPS)/client: No change in performance detected.
       time:   [313.57 ms 317.02 ms 320.50 ms]
       thrpt:  [31.201 Kelem/s 31.543 Kelem/s 31.891 Kelem/s]
change:
       time:   [-1.4297% +0.1767% +1.7310%] (p = 0.83 > 0.05)
       thrpt:  [-1.7015% -0.1763% +1.4505%]
1-conn/1-1b-resp (aka. HPS)/client: No change in performance detected.
       time:   [34.126 ms 34.338 ms 34.566 ms]
       thrpt:  [28.931  elem/s 29.122  elem/s 29.303  elem/s]
change:
       time:   [-1.3284% -0.3843% +0.4900%] (p = 0.42 > 0.05)
       thrpt:  [-0.4876% +0.3858% +1.3463%]

Found 4 outliers among 100 measurements (4.00%)
4 (4.00%) high mild

Client/server transfer results

Transfer of 33554432 bytes over loopback.

Client Server CC Pacing Mean [ms] Min [ms] Max [ms] Relative
msquic msquic 173.6 ± 108.1 98.4 519.5 1.00
neqo msquic reno on 238.5 ± 41.9 205.5 353.3 1.00
neqo msquic reno 239.3 ± 61.3 209.6 448.5 1.00
neqo msquic cubic on 240.9 ± 56.4 213.8 416.4 1.00
neqo msquic cubic 262.3 ± 85.2 214.6 469.3 1.00
msquic neqo reno on 158.0 ± 88.7 85.6 355.4 1.00
msquic neqo reno 128.1 ± 79.4 81.1 354.3 1.00
msquic neqo cubic on 146.5 ± 80.4 86.0 329.3 1.00
msquic neqo cubic 139.7 ± 92.1 82.5 503.9 1.00
neqo neqo reno on 152.1 ± 16.0 123.8 175.7 1.00
neqo neqo reno 201.8 ± 86.4 130.2 408.7 1.00
neqo neqo cubic on 192.0 ± 67.7 128.8 380.7 1.00
neqo neqo cubic 246.3 ± 129.1 134.9 582.3 1.00

⬇️ Download logs

Copy link

github-actions bot commented Sep 16, 2024

Firefox builds for this PR

The following builds are available for testing. Crossed-out builds did not succeed.

@larseggert larseggert merged commit eb3e835 into mozilla:main Sep 18, 2024
56 checks passed
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