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

chore: Remove some unwraps and replace others by expect #2294

Open
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

larseggert
Copy link
Collaborator

@larseggert larseggert commented Dec 19, 2024

In functions that return Result or Option or where it is easy to make them do so w/o too many other code changes.

This lets us enable the clippy unwrap_used check, which is a nice reminder not to be casual with unwrap.

In functions that return `Result`.
Copy link

github-actions bot commented Dec 19, 2024

Failed Interop Tests

QUIC Interop Runner, client vs. server, differences relative to 085fa62.

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

codecov bot commented Dec 19, 2024

Codecov Report

Attention: Patch coverage is 89.95536% with 45 lines in your changes missing coverage. Please review.

Project coverage is 95.24%. Comparing base (678380b) to head (a3f3a9c).
Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
.../features/extended_connect/webtransport_session.rs 53.84% 12 Missing ⚠️
neqo-transport/src/send_stream.rs 84.90% 8 Missing ⚠️
neqo-transport/src/connection/mod.rs 85.71% 5 Missing ⚠️
neqo-crypto/src/agent.rs 73.33% 4 Missing ⚠️
neqo-crypto/src/agentio.rs 66.66% 4 Missing ⚠️
neqo-transport/src/recovery/mod.rs 86.66% 4 Missing ⚠️
neqo-qpack/src/decoder.rs 66.66% 2 Missing ⚠️
neqo-transport/src/path.rs 86.66% 2 Missing ⚠️
neqo-transport/src/tracking.rs 97.05% 2 Missing ⚠️
neqo-http3/src/connection.rs 93.75% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2294      +/-   ##
==========================================
- Coverage   95.29%   95.24%   -0.06%     
==========================================
  Files         114      114              
  Lines       36844    36877      +33     
  Branches    36844    36877      +33     
==========================================
+ Hits        35111    35122      +11     
- Misses       1727     1749      +22     
  Partials        6        6              

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

@larseggert larseggert changed the title chore: Remove some unwraps chore: Remove some unwraps and replace others by expect Dec 20, 2024
Copy link
Member

@martinthomson martinthomson left a comment

Choose a reason for hiding this comment

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

Lots of improvements here, but there are a few places where some of that could be improved.

(Non-blocking comment as I'm going on leave.)

neqo-crypto/src/agent.rs Outdated Show resolved Hide resolved
@@ -22,6 +22,7 @@ fn se_create() {
const PLAINTEXT: &[u8] = b"PLAINTEXT";
const AAD: &[u8] = b"AAD";

#[cfg(test)]
Copy link
Member

Choose a reason for hiding this comment

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

?? This is in tests/. Why would it need this?

Copy link
Collaborator Author

@larseggert larseggert Dec 27, 2024

Choose a reason for hiding this comment

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

I don't know, but it does. Otherwise clippy complains.

neqo-http3/src/client_events.rs Outdated Show resolved Hide resolved
neqo-transport/src/crypto.rs Outdated Show resolved Hide resolved
neqo-transport/src/path.rs Show resolved Hide resolved
neqo-transport/src/path.rs Outdated Show resolved Hide resolved
neqo-transport/src/recovery/mod.rs Outdated Show resolved Hide resolved
neqo-transport/src/tparams.rs Outdated Show resolved Hide resolved
larseggert and others added 6 commits December 27, 2024 11:06
Copy link

github-actions bot commented Jan 7, 2025

Benchmark results

Performance differences relative to 6013bde.

decode 4096 bytes, mask ff: No change in performance detected.
       time:   [11.181 µs 11.230 µs 11.284 µs]
       change: [-0.0792% +0.3436% +0.7985%] (p = 0.13 > 0.05)

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

decode 1048576 bytes, mask ff: No change in performance detected.
       time:   [3.0185 ms 3.0282 ms 3.0393 ms]
       change: [-0.5043% -0.0128% +0.4833%] (p = 0.96 > 0.05)

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

decode 4096 bytes, mask 7f: No change in performance detected.
       time:   [19.546 µs 19.602 µs 19.663 µs]
       change: [-0.6599% +0.1716% +1.1972%] (p = 0.74 > 0.05)

Found 23 outliers among 100 measurements (23.00%)
1 (1.00%) low severe
3 (3.00%) low mild
2 (2.00%) high mild
17 (17.00%) high severe

decode 1048576 bytes, mask 7f: No change in performance detected.
       time:   [5.1564 ms 5.1675 ms 5.1792 ms]
       change: [-0.5253% -0.1676% +0.1604%] (p = 0.34 > 0.05)

Found 11 outliers among 100 measurements (11.00%)
11 (11.00%) high severe

decode 4096 bytes, mask 3f: No change in performance detected.
       time:   [5.5377 µs 5.5741 µs 5.6188 µs]
       change: [-0.8808% -0.1328% +0.5290%] (p = 0.73 > 0.05)

Found 6 outliers among 100 measurements (6.00%)
1 (1.00%) high mild
5 (5.00%) high severe

decode 1048576 bytes, mask 3f: 💔 Performance has regressed.
       time:   [1.7915 ms 1.8040 ms 1.8165 ms]
       change: [+1.4211% +2.1934% +2.9787%] (p = 0.00 < 0.05)
coalesce_acked_from_zero 1+1 entries: Change within noise threshold.
       time:   [99.168 ns 99.453 ns 99.752 ns]
       change: [+0.2198% +0.6792% +1.1706%] (p = 0.00 < 0.05)

Found 10 outliers among 100 measurements (10.00%)
3 (3.00%) high mild
7 (7.00%) high severe

coalesce_acked_from_zero 3+1 entries: Change within noise threshold.
       time:   [118.37 ns 118.72 ns 119.10 ns]
       change: [+0.6581% +1.5735% +2.3393%] (p = 0.00 < 0.05)

Found 21 outliers among 100 measurements (21.00%)
5 (5.00%) low severe
2 (2.00%) high mild
14 (14.00%) high severe

coalesce_acked_from_zero 10+1 entries: 💔 Performance has regressed.
       time:   [118.04 ns 118.50 ns 119.06 ns]
       change: [+1.0117% +2.6257% +5.3661%] (p = 0.01 < 0.05)

Found 15 outliers among 100 measurements (15.00%)
5 (5.00%) low severe
1 (1.00%) low mild
2 (2.00%) high mild
7 (7.00%) high severe

coalesce_acked_from_zero 1000+1 entries: No change in performance detected.
       time:   [98.135 ns 98.284 ns 98.450 ns]
       change: [-0.4789% +0.7807% +1.9058%] (p = 0.22 > 0.05)

Found 10 outliers among 100 measurements (10.00%)
3 (3.00%) high mild
7 (7.00%) high severe

RxStreamOrderer::inbound_frame(): 💔 Performance has regressed.
       time:   [115.53 ms 115.59 ms 115.64 ms]
       change: [+3.8280% +4.0390% +4.1720%] (p = 0.00 < 0.05)

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

SentPackets::take_ranges: No change in performance detected.
       time:   [5.4843 µs 5.6582 µs 5.8469 µs]
       change: [-1.3856% +1.1943% +3.7670%] (p = 0.37 > 0.05)

Found 9 outliers among 100 measurements (9.00%)
6 (6.00%) high mild
3 (3.00%) high severe

transfer/pacing-false/varying-seeds: 💔 Performance has regressed.
       time:   [43.809 ms 43.892 ms 43.989 ms]
       change: [+4.8991% +5.2028% +5.5040%] (p = 0.00 < 0.05)

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

transfer/pacing-true/varying-seeds: 💔 Performance has regressed.
       time:   [44.118 ms 44.202 ms 44.293 ms]
       change: [+4.9296% +5.1942% +5.4738%] (p = 0.00 < 0.05)

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

transfer/pacing-false/same-seed: 💔 Performance has regressed.
       time:   [43.867 ms 43.945 ms 44.036 ms]
       change: [+4.8077% +5.0866% +5.4034%] (p = 0.00 < 0.05)

Found 3 outliers among 100 measurements (3.00%)
2 (2.00%) high mild
1 (1.00%) high severe

transfer/pacing-true/same-seed: 💔 Performance has regressed.
       time:   [43.889 ms 43.963 ms 44.040 ms]
       change: [+4.1698% +4.4211% +4.6685%] (p = 0.00 < 0.05)

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

1-conn/1-100mb-resp/mtu-1504 (aka. Download)/client: Change within noise threshold.
       time:   [891.91 ms 901.57 ms 911.36 ms]
       thrpt:  [109.73 MiB/s 110.92 MiB/s 112.12 MiB/s]
change:
       time:   [+0.0451% +1.6539% +3.2647%] (p = 0.04 < 0.05)
       thrpt:  [-3.1615% -1.6270% -0.0451%]
1-conn/10_000-parallel-1b-resp/mtu-1504 (aka. RPS)/client: No change in performance detected.
       time:   [302.83 ms 304.91 ms 307.06 ms]
       thrpt:  [32.567 Kelem/s 32.796 Kelem/s 33.022 Kelem/s]
change:
       time:   [-0.1388% +0.8404% +1.8094%] (p = 0.10 > 0.05)
       thrpt:  [-1.7772% -0.8334% +0.1390%]

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

1-conn/1-1b-resp/mtu-1504 (aka. HPS)/client: No change in performance detected.
       time:   [34.204 ms 34.406 ms 34.631 ms]
       thrpt:  [28.876  elem/s 29.064  elem/s 29.237  elem/s]
change:
       time:   [-0.5783% +0.2941% +1.1259%] (p = 0.51 > 0.05)
       thrpt:  [-1.1133% -0.2932% +0.5817%]

Found 11 outliers among 100 measurements (11.00%)
2 (2.00%) low mild
3 (3.00%) high mild
6 (6.00%) high severe

1-conn/1-100mb-resp/mtu-1504 (aka. Upload)/client: 💔 Performance has regressed.
       time:   [1.7109 s 1.7279 s 1.7453 s]
       thrpt:  [57.298 MiB/s 57.872 MiB/s 58.448 MiB/s]
change:
       time:   [+2.5789% +4.1383% +5.7202%] (p = 0.00 < 0.05)
       thrpt:  [-5.4107% -3.9739% -2.5140%]

Client/server transfer results

Transfer of 33554432 bytes over loopback.

Client Server CC Pacing MTU Mean [ms] Min [ms] Max [ms]
gquiche gquiche 1504 555.7 ± 92.3 499.9 758.4
neqo gquiche reno on 1504 826.4 ± 85.3 763.0 977.3
neqo gquiche reno 1504 812.5 ± 133.7 756.5 1191.7
neqo gquiche cubic on 1504 771.0 ± 21.9 742.5 815.6
neqo gquiche cubic 1504 791.3 ± 85.3 740.0 1027.2
msquic msquic 1504 171.6 ± 86.5 98.2 356.3
neqo msquic reno on 1504 277.7 ± 85.3 209.1 389.7
neqo msquic reno 1504 252.2 ± 74.8 204.6 421.2
neqo msquic cubic on 1504 268.9 ± 82.4 203.8 422.6
neqo msquic cubic 1504 273.6 ± 83.8 211.1 418.6
gquiche neqo reno on 1504 724.5 ± 127.8 552.3 942.4
gquiche neqo reno 1504 736.1 ± 110.8 608.6 992.8
gquiche neqo cubic on 1504 700.3 ± 87.3 566.2 815.9
gquiche neqo cubic 1504 689.9 ± 89.3 585.0 812.8
msquic neqo reno on 1504 500.6 ± 40.2 471.8 611.4
msquic neqo reno 1504 561.5 ± 82.7 482.7 719.2
msquic neqo cubic on 1504 521.3 ± 50.1 481.1 642.2
msquic neqo cubic 1504 535.4 ± 51.1 479.0 606.3
neqo neqo reno on 1504 542.1 ± 78.9 472.9 748.6
neqo neqo reno 1504 556.6 ± 93.1 474.1 759.5
neqo neqo cubic on 1504 546.3 ± 44.2 484.3 622.2
neqo neqo cubic 1504 558.5 ± 46.7 489.3 672.4

⬇️ Download logs

@mxinden
Copy link
Collaborator

mxinden commented Jan 13, 2025

@larseggert let me know once you want another review.

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.

3 participants