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

feat: In-place crypto #2385

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Conversation

larseggert
Copy link
Collaborator

@larseggert larseggert commented Jan 23, 2025

Only in-place encryption so far, and only for the main data path.

There is some support for in-place decryption, but I am running into borrow-checker issues, so this needs more work.

Fixes #2246 (eventually)

Only in-place encryption so far, and only for the main data path.

Fixes mozilla#2246 (eventually)
Copy link

codecov bot commented Jan 23, 2025

Codecov Report

Attention: Patch coverage is 98.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 95.29%. Comparing base (c4db9b5) to head (813b17c).

Files with missing lines Patch % Lines
neqo-crypto/src/aead.rs 95.83% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2385   +/-   ##
=======================================
  Coverage   95.29%   95.29%           
=======================================
  Files         114      114           
  Lines       36850    36887   +37     
  Branches    36850    36887   +37     
=======================================
+ Hits        35117    35153   +36     
- Misses       1727     1728    +1     
  Partials        6        6           

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

Copy link

github-actions bot commented Jan 23, 2025

Failed Interop Tests

None ❓

All results

Succeeded Interop Tests

None ❓

Unsupported Interop Tests

None ❓

Copy link

Benchmark results

Performance differences relative to 7a25920.

decode 4096 bytes, mask ff: No change in performance detected.
       time:   [11.859 µs 11.901 µs 11.949 µs]
       change: [-0.2487% +0.3125% +1.0233%] (p = 0.35 > 0.05)

Found 21 outliers among 100 measurements (21.00%)
5 (5.00%) low severe
6 (6.00%) low mild
1 (1.00%) high mild
9 (9.00%) high severe

decode 1048576 bytes, mask ff: Change within noise threshold.
       time:   [2.9217 ms 2.9324 ms 2.9451 ms]
       change: [+0.6419% +1.1894% +1.7654%] (p = 0.00 < 0.05)

Found 8 outliers among 100 measurements (8.00%)
8 (8.00%) high severe

decode 4096 bytes, mask 7f: No change in performance detected.
       time:   [19.773 µs 19.812 µs 19.859 µs]
       change: [-0.5785% -0.1092% +0.3546%] (p = 0.66 > 0.05)

Found 21 outliers among 100 measurements (21.00%)
6 (6.00%) low mild
4 (4.00%) high mild
11 (11.00%) high severe

decode 1048576 bytes, mask 7f: Change within noise threshold.
       time:   [5.0440 ms 5.0548 ms 5.0665 ms]
       change: [-1.0334% -0.6788% -0.3454%] (p = 0.00 < 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

decode 4096 bytes, mask 3f: No change in performance detected.
       time:   [6.8936 µs 6.9181 µs 6.9500 µs]
       change: [-0.5356% -0.0613% +0.3927%] (p = 0.81 > 0.05)

Found 14 outliers among 100 measurements (14.00%)
8 (8.00%) low mild
2 (2.00%) high mild
4 (4.00%) high severe

decode 1048576 bytes, mask 3f: No change in performance detected.
       time:   [1.4141 ms 1.4196 ms 1.4264 ms]
       change: [-0.4984% +0.0794% +0.6660%] (p = 0.84 > 0.05)

Found 5 outliers among 100 measurements (5.00%)
5 (5.00%) high severe

coalesce_acked_from_zero 1+1 entries: No change in performance detected.
       time:   [98.591 ns 98.931 ns 99.275 ns]
       change: [-1.1847% -0.5142% +0.0274%] (p = 0.10 > 0.05)

Found 12 outliers among 100 measurements (12.00%)
10 (10.00%) high mild
2 (2.00%) high severe

coalesce_acked_from_zero 3+1 entries: No change in performance detected.
       time:   [116.49 ns 116.85 ns 117.23 ns]
       change: [-0.6019% -0.1325% +0.2476%] (p = 0.57 > 0.05)

Found 8 outliers among 100 measurements (8.00%)
8 (8.00%) high severe

coalesce_acked_from_zero 10+1 entries: No change in performance detected.
       time:   [116.22 ns 116.71 ns 117.28 ns]
       change: [-0.5387% -0.0277% +0.4373%] (p = 0.92 > 0.05)

Found 11 outliers among 100 measurements (11.00%)
5 (5.00%) low mild
6 (6.00%) high severe

coalesce_acked_from_zero 1000+1 entries: No change in performance detected.
       time:   [97.294 ns 97.432 ns 97.583 ns]
       change: [-0.5025% +0.5665% +1.8769%] (p = 0.37 > 0.05)

Found 12 outliers among 100 measurements (12.00%)
3 (3.00%) high mild
9 (9.00%) high severe

RxStreamOrderer::inbound_frame(): Change within noise threshold.
       time:   [111.47 ms 111.52 ms 111.56 ms]
       change: [-0.1939% -0.1348% -0.0736%] (p = 0.00 < 0.05)

Found 10 outliers among 100 measurements (10.00%)
5 (5.00%) low mild
5 (5.00%) high mild

SentPackets::take_ranges: No change in performance detected.
       time:   [5.3948 µs 5.5017 µs 5.6185 µs]
       change: [-3.9735% -1.3343% +1.2731%] (p = 0.32 > 0.05)

Found 5 outliers among 100 measurements (5.00%)
1 (1.00%) high mild
4 (4.00%) high severe

transfer/pacing-false/varying-seeds: Change within noise threshold.
       time:   [40.229 ms 40.304 ms 40.380 ms]
       change: [-1.8575% -1.5939% -1.3286%] (p = 0.00 < 0.05)

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

transfer/pacing-true/varying-seeds: Change within noise threshold.
       time:   [40.337 ms 40.405 ms 40.476 ms]
       change: [-2.5264% -2.3114% -2.0862%] (p = 0.00 < 0.05)

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

transfer/pacing-false/same-seed: Change within noise threshold.
       time:   [40.248 ms 40.301 ms 40.354 ms]
       change: [-1.8674% -1.6855% -1.4966%] (p = 0.00 < 0.05)

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

transfer/pacing-true/same-seed: Change within noise threshold.
       time:   [39.978 ms 40.035 ms 40.092 ms]
       change: [-2.4841% -2.2905% -2.1003%] (p = 0.00 < 0.05)
1-conn/1-100mb-resp/mtu-1504 (aka. Download)/client: 💚 Performance has improved.
       time:   [838.95 ms 847.68 ms 856.64 ms]
       thrpt:  [116.73 MiB/s 117.97 MiB/s 119.20 MiB/s]
change:
       time:   [-7.6936% -6.1620% -4.6550%] (p = 0.00 < 0.05)
       thrpt:  [+4.8822% +6.5666% +8.3348%]
1-conn/10_000-parallel-1b-resp/mtu-1504 (aka. RPS)/client: No change in performance detected.
       time:   [316.24 ms 318.40 ms 320.60 ms]
       thrpt:  [31.191 Kelem/s 31.407 Kelem/s 31.622 Kelem/s]
change:
       time:   [-0.4975% +0.5384% +1.5541%] (p = 0.30 > 0.05)
       thrpt:  [-1.5303% -0.5355% +0.4999%]

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

1-conn/1-1b-resp/mtu-1504 (aka. HPS)/client: No change in performance detected.
       time:   [34.105 ms 34.332 ms 34.573 ms]
       thrpt:  [28.924  elem/s 29.128  elem/s 29.321  elem/s]
change:
       time:   [-0.8174% -0.0060% +0.8076%] (p = 0.99 > 0.05)
       thrpt:  [-0.8012% +0.0060% +0.8241%]

Found 7 outliers among 100 measurements (7.00%)
5 (5.00%) high mild
2 (2.00%) high severe

1-conn/1-100mb-resp/mtu-1504 (aka. Upload)/client: No change in performance detected.
       time:   [1.7018 s 1.7196 s 1.7374 s]
       thrpt:  [57.557 MiB/s 58.153 MiB/s 58.761 MiB/s]
change:
       time:   [-1.0411% +0.4555% +1.9886%] (p = 0.56 > 0.05)
       thrpt:  [-1.9498% -0.4535% +1.0521%]

Client/server transfer results

Transfer of 33554432 bytes over loopback.

Client Server CC Pacing MTU Mean [ms] Min [ms] Max [ms]
gquiche gquiche 1504 551.2 ± 49.0 515.0 629.4
neqo gquiche reno on 1504 760.4 ± 17.7 734.4 798.5
neqo gquiche reno 1504 764.5 ± 6.8 755.2 775.7
neqo gquiche cubic on 1504 773.3 ± 26.5 734.9 818.3
neqo gquiche cubic 1504 747.6 ± 43.6 696.1 862.0
msquic msquic 1504 146.5 ± 88.6 94.0 369.1
neqo msquic reno on 1504 209.9 ± 10.9 197.2 225.7
neqo msquic reno 1504 260.3 ± 75.0 205.1 459.7
neqo msquic cubic on 1504 252.4 ± 89.9 206.1 544.4
neqo msquic cubic 1504 268.0 ± 116.0 199.8 564.4
gquiche neqo reno on 1504 667.9 ± 81.1 548.8 785.7
gquiche neqo reno 1504 688.8 ± 69.3 599.6 788.9
gquiche neqo cubic on 1504 672.4 ± 84.6 548.0 795.1
gquiche neqo cubic 1504 688.7 ± 114.2 553.0 948.3
msquic neqo reno on 1504 475.4 ± 7.0 462.8 482.9
msquic neqo reno 1504 510.9 ± 57.0 456.4 641.8
msquic neqo cubic on 1504 505.4 ± 89.4 449.1 696.2
msquic neqo cubic 1504 465.2 ± 8.4 450.5 474.1
neqo neqo reno on 1504 442.1 ± 25.6 417.5 497.2
neqo neqo reno 1504 432.7 ± 10.0 414.9 445.5
neqo neqo cubic on 1504 453.1 ± 13.2 432.7 470.5
neqo neqo cubic 1504 481.1 ± 60.3 432.5 591.4

⬇️ Download logs

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.

perf: consider in-place en- and decryption
1 participant