Skip to content

Implement BufRead for Reader, Stream, and StreamOwned - #2303

Merged
ctz merged 7 commits into
rustls:mainfrom
goffrie:bufread
Jan 27, 2025
Merged

ctz merged 7 commits into
rustls:mainfrom
goffrie:bufread

Conversation

@goffrie

@goffrie goffrie commented Jan 16, 2025 •

Copy link
Copy Markdown
Contributor

This is basically a reroll of #870 against the latest version of the code.

New in this PR is an alternate method Reader::into_first_chunk (other naming suggestions welcome) that acts like fill_buf but returns a slice with a longer lifetime, at the cost of consuming self (needed in order to steal the &mut ConnectionCommon borrow). This makes it possible to implement AsyncBufRead in tokio_rustls without necessarily implementing BufRead directly on ConnectionCommon. It's also needed to implement BufRead for StreamOwned.

@codecov

codecov Bot commented Jan 17, 2025 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 96.15385% with 2 lines in your changes missing coverage. Please review.

Project coverage is 94.83%. Comparing base (d1bd2c8) to head (b1b2438).
Report is 20 commits behind head on main.

Files with missing lines Patch % Lines
rustls/src/conn.rs 89.47% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2303   +/-   ##
=======================================
  Coverage   94.82%   94.83%           
=======================================
  Files         104      104           
  Lines       24100    24150   +50     
=======================================
+ Hits        22853    22902   +49     
- Misses       1247     1248    +1     

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

@djc djc left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you restate in the PR description what you are trying to achieve with this PR? Have you benchmarked your proposed tokio-rustls changes?

Comment thread rustls/src/conn.rs Resolved
Comment thread rustls/src/conn.rs Resolved
@djc

djc commented Jan 20, 2025

Copy link
Copy Markdown
Member

I'll let @ctz have a look at this first.

@ctz ctz left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this looks fairly reasonable? Naturally it needs tests.

Mostly unrelated: I've also considered adding a pub fn take_chunk(&mut self) -> io::Result<Option<Vec<u8>>> to Reader, to allow move-style buffered IO (rather than the copy-style IO implied by all the std::io traits.) I don't think that helps or hinders with this addition though.

@cpu

cpu commented Jan 20, 2025

Copy link
Copy Markdown
Member

Naturally it needs tests.

If this is motivated by a downstream need in tokio-rustls it would also be nice to see a draft implementing that side before this is merged.

@goffrie

goffrie commented Jan 21, 2025

Copy link
Copy Markdown
Contributor Author

Here is the downstream PR: rustls/tokio-rustls#100

I will add tests.

@goffrie goffrie changed the title Implement BufRead for Reader Implement BufRead for Reader, Stream, and StreamOwned Jan 21, 2025
@goffrie

goffrie commented Jan 21, 2025

Copy link
Copy Markdown
Contributor Author

I added a number of tests for BufRead behaviour and cleaned up the code a bit too. I've extended the PR to implement BufRead for Stream/StreamOwned as it seemed logical and some tests that I wanted to extend were relying on it.

@goffrie

goffrie commented Jan 22, 2025

Copy link
Copy Markdown
Contributor Author

This also provides a foundation to easily resolve rustls/tokio-rustls#55 (without rewriting the whole thing to use the unbuffered API): rustls/tokio-rustls@655c396?w=1

Comment thread rustls/src/vecbuf.rs Resolved
Comment thread rustls/src/conn.rs Resolved
Comment thread rustls/src/conn.rs Resolved
Comment thread rustls/src/stream.rs Resolved
Comment thread rustls/src/stream.rs Resolved
Comment thread rustls/src/stream.rs Resolved
Comment thread rustls/src/conn.rs Resolved
@goffrie
goffrie force-pushed the bufread branch 2 times, most recently from c6e7ce8 to 6f1ddc8 Compare January 23, 2025 18:56
@goffrie

goffrie commented Jan 23, 2025

Copy link
Copy Markdown
Contributor Author

I've cleaned up the commit history. I didn't realize this project preserves commits from PRs when merging - my mistake for not reading CONTRIBUTING.md carefully.

@djc djc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice, this now has a pretty clean commit history. Some minor questions left.

Comment thread rustls/src/conn.rs Resolved
Comment thread rustls/src/conn.rs Outdated

impl BufRead for Reader<'_> {
/// Obtain a chunk of plaintext data received from the peer over this TLS connection.
/// This reads the same data as [`Reader::read`], but returns a reference instead of

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: please refer to functions and methods with trailing () in order to distinguish from fields.

@rustls-benchmarking

rustls-benchmarking Bot commented Jan 24, 2025 •

Copy link
Copy Markdown

Benchmark results

Instruction counts

Significant differences

There are no significant instruction count differences

Other differences

Click to expand
Scenario Baseline Candidate Diff Threshold
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_aes_client 8256604 8303642 47038 (0.57%) 0.58%
handshake_no_resume_aws_lc_rs_1.2_rsa_aes_server 10469854 10437828 -32026 (-0.31%) 1.11%
handshake_no_resume_aws_lc_rs_1.3_rsa_aes_server 10718574 10708670 -9904 (-0.09%) 0.67%
handshake_no_resume_ring_1.3_ecdsap256_chacha_client 3624656 3622579 -2077 (-0.06%) 0.23%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_chacha_client 8290060 8287834 -2226 (-0.03%) 0.87%
handshake_no_resume_aws_lc_rs_1.3_rsa_chacha_server 10739527 10741470 1943 (0.02%) 0.49%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_chacha_server 1176834 1176909 75 (0.01%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_chacha_client 3082516 3082344 -172 (-0.01%) 0.24%
handshake_no_resume_ring_1.3_ecdsap256_aes_client 3623266 3623109 -157 (-0.00%) 0.22%
handshake_session_id_aws_lc_rs_1.2_rsa_aes_client 3864355 3864205 -150 (-0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.2_rsa_aes_client 4206439 4206289 -150 (-0.00%) 0.20%
handshake_session_id_ring_1.2_rsa_aes_client 4229019 4228869 -150 (-0.00%) 0.20%
handshake_tickets_ring_1.2_rsa_aes_client 4489533 4489383 -150 (-0.00%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_rsa_chacha_client 1932577 1932534 -43 (-0.00%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_aes_client 3080551 3080618 67 (0.00%) 0.20%
handshake_no_resume_ring_1.3_rsa_aes_client 2655922 2655875 -47 (-0.00%) 0.20%
handshake_no_resume_ring_1.3_rsa_chacha_client 2661789 2661742 -47 (-0.00%) 0.20%
handshake_no_resume_ring_1.2_rsa_aes_client 2563547 2563503 -44 (-0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.2_rsa_aes_server 3872463 3872523 60 (0.00%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_rsa_aes_client 1925831 1925803 -28 (-0.00%) 0.20%
handshake_session_id_ring_1.2_rsa_aes_server 4233520 4233580 60 (0.00%) 0.20%
handshake_tickets_ring_1.2_rsa_aes_server 4698000 4698060 60 (0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.2_rsa_aes_server 5019734 5019794 60 (0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_aes_server 28970532 28970851 319 (0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_rsa_chacha_client 27787031 27787318 287 (0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_aes_client 28206884 28207165 281 (0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_chacha_client 27782806 27782561 -245 (-0.00%) 0.20%
handshake_no_resume_ring_1.3_ecdsap256_chacha_server 1613606 1613619 13 (0.00%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_aes_server 2160042 2160057 15 (0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_rsa_aes_server 30420235 30420441 206 (0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_chacha_server 30380674 30380470 -204 (-0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_rsa_aes_client 27846328 27846495 167 (0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_rsa_chacha_server 28890146 28889978 -168 (-0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_aes_server 28970724 28970574 -150 (-0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_chacha_client 28174030 28174173 143 (0.00%) 0.20%
handshake_no_resume_aws_lc_rs_1.2_rsa_aes_client 1717778 1717786 8 (0.00%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_aes_server 1174543 1174547 4 (0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_chacha_client 28177155 28177242 87 (0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_aes_server 30423160 30423246 86 (0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_chacha_server 28892377 28892456 79 (0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_chacha_server 30380194 30380126 -68 (-0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_aes_server 30422730 30422797 67 (0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_rsa_aes_client 28210980 28210918 -62 (-0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_rsa_chacha_server 30377806 30377872 66 (0.00%) 0.20%
handshake_no_resume_ring_1.3_ecdsap384_aes_client 35180676 35180605 -71 (-0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_aes_client 27842033 27842074 41 (0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_rsa_chacha_client 28180996 28180959 -37 (-0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_chacha_client 27780171 27780206 35 (0.00%) 0.20%
handshake_no_resume_ring_1.3_ecdsap384_chacha_client 35182595 35182552 -43 (-0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_chacha_server 28892335 28892369 34 (0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_aes_client 28203940 28203955 15 (0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_rsa_aes_server 28968332 28968343 11 (0.00%) 0.20%
handshake_no_resume_ring_1.2_rsa_aes_server 11292436 11292439 3 (0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_aes_server 46464558 46464567 9 (0.00%) 0.20%
transfer_no_resume_ring_1.3_rsa_aes_client 58342701 58342690 -11 (-0.00%) 0.20%
transfer_no_resume_ring_1.2_rsa_aes_server 46389586 46389594 8 (0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_rsa_aes_client 58245689 58245679 -10 (-0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_aes_client 58240732 58240723 -9 (-0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_rsa_aes_server 46477531 46477538 7 (0.00%) 0.20%
transfer_no_resume_ring_1.2_rsa_aes_client 58225379 58225387 8 (0.00%) 0.20%
handshake_no_resume_ring_1.3_ecdsap384_aes_server 7564560 7564559 -1 (-0.00%) 0.20%
transfer_no_resume_ring_1.3_rsa_aes_server 46487100 46487094 -6 (-0.00%) 0.20%
transfer_no_resume_ring_1.3_ecdsap256_chacha_server 80535642 80535651 9 (0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_rsa_chacha_client 92710957 92710967 10 (0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_chacha_server 80641263 80641255 -8 (-0.00%) 0.20%
transfer_no_resume_ring_1.3_ecdsap256_aes_server 46467803 46467807 4 (0.00%) 0.20%
transfer_no_resume_ring_1.3_ecdsap384_chacha_server 80540451 80540445 -6 (-0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_aes_client 27839488 27839486 -2 (-0.00%) 0.20%
transfer_no_resume_ring_1.3_ecdsap384_chacha_client 92673024 92673018 -6 (-0.00%) 0.20%
transfer_no_resume_ring_1.3_rsa_chacha_server 80554930 80554935 5 (0.00%) 0.20%
transfer_no_resume_ring_1.3_ecdsap256_chacha_client 92663959 92663955 -4 (-0.00%) 0.20%
transfer_no_resume_ring_1.3_rsa_chacha_client 92674856 92674860 4 (0.00%) 0.20%
transfer_no_resume_ring_1.3_ecdsap256_aes_client 58331790 58331792 2 (0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_chacha_client 92706963 92706961 -2 (-0.00%) 0.20%
transfer_no_resume_ring_1.3_ecdsap384_aes_server 46470684 46470683 -1 (-0.00%) 0.20%
transfer_no_resume_ring_1.3_ecdsap384_aes_client 58338938 58338937 -1 (-0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_chacha_server 80648882 80648883 1 (0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_rsa_chacha_server 80661853 80661852 -1 (-0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_chacha_client 92704730 92704731 1 (0.00%) 0.20%
handshake_session_id_ring_1.3_ecdsap384_aes_server 41610759 41610759 0 (0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.2_rsa_aes_server 46423828 46423828 0 (0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_aes_server 46456934 46456934 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_ecdsap256_aes_client 40277252 40277252 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_rsa_aes_client 40578950 40578950 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_rsa_aes_client 40281303 40281303 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_ecdsap384_aes_server 42070688 42070688 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_ecdsap256_chacha_client 40500760 40500760 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_rsa_chacha_client 40186983 40186983 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_rsa_chacha_client 40504760 40504760 0 (0.00%) 0.20%
handshake_no_resume_ring_1.3_ecdsap256_aes_server 1612230 1612230 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_ecdsap384_aes_client 40274309 40274309 0 (0.00%) 0.20%
handshake_no_resume_ring_1.3_rsa_chacha_server 11430994 11430994 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_ecdsap384_chacha_server 41492499 41492499 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_ecdsap256_aes_client 40574950 40574950 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_ecdsap384_chacha_server 41972348 41972348 0 (0.00%) 0.20%
handshake_no_resume_ring_1.3_rsa_aes_server 11425039 11425039 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_ecdsap384_chacha_client 40179989 40179989 0 (0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.2_rsa_aes_client 58181210 58181210 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_rsa_aes_server 41608658 41608658 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_ecdsap384_aes_client 40571689 40571689 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_rsa_chacha_server 41490398 41490398 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_ecdsap256_chacha_server 41492451 41492451 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_rsa_chacha_server 41969798 41969798 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_ecdsap256_chacha_client 40182932 40182932 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_ecdsap256_aes_server 41610711 41610711 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_ecdsap256_chacha_server 41972158 41972158 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_ecdsap384_chacha_client 40497499 40497499 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_rsa_aes_server 42068138 42068138 0 (0.00%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_chacha_server 2163089 2163089 0 (0.00%) 0.20%
handshake_no_resume_ring_1.3_ecdsap384_chacha_server 7566714 7566714 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_ecdsap256_aes_server 42070498 42070498 0 (0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_aes_client 58243602 58243602 0 (0.00%) 0.20%

Wall-time

Significant differences

⚠️ There are significant wall-time differences

Click to expand
Scenario Baseline Candidate Diff Threshold
handshake_no_resume_aws_lc_rs_1.2_rsa_aes 1.07 ms 1.10 ms ⚠️ 0.03 ms (3.04%) 2.25%
handshake_no_resume_aws_lc_rs_1.3_rsa_aes 1.10 ms 1.13 ms ⚠️ 0.03 ms (2.50%) 2.19%
handshake_tickets_aws_lc_rs_1.2_rsa_aes 1.78 ms 1.82 ms ⚠️ 0.04 ms (2.17%) 1.63%
handshake_session_id_aws_lc_rs_1.2_rsa_aes 1.61 ms 1.64 ms ⚠️ 0.02 ms (1.48%) 1.40%

Other differences

Click to expand
Scenario Baseline Candidate Diff Threshold
transfer_no_resume_aws_lc_rs_1.2_rsa_aes 5.06 ms 5.13 ms 0.07 ms (1.48%) 6.97%
transfer_no_resume_aws_lc_rs_1.3_rsa_aes 5.12 ms 5.19 ms 0.07 ms (1.41%) 7.31%
handshake_no_resume_aws_lc_rs_1.3_rsa_chacha 1.11 ms 1.12 ms 0.01 ms (1.13%) 1.44%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_aes 4.47 ms 4.52 ms 0.05 ms (1.11%) 7.41%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_chacha 4.32 ms 4.28 ms -0.04 ms (-1.02%) 1.72%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_aes 5.17 ms 5.22 ms 0.05 ms (0.99%) 6.37%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_chacha 5.01 ms 4.97 ms -0.05 ms (-0.91%) 1.22%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_chacha 4.51 ms 4.48 ms -0.03 ms (-0.76%) 1.42%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_chacha 5.21 ms 5.17 ms -0.03 ms (-0.67%) 1.28%
handshake_tickets_ring_1.3_rsa_aes 6.97 ms 6.92 ms -0.04 ms (-0.62%) 1.26%
handshake_tickets_ring_1.2_rsa_aes 1.61 ms 1.60 ms -0.01 ms (-0.61%) 1.57%
handshake_tickets_ring_1.3_ecdsap256_aes 6.47 ms 6.43 ms -0.04 ms (-0.60%) 1.16%
transfer_no_resume_ring_1.3_ecdsap256_aes 6.33 ms 6.36 ms 0.03 ms (0.51%) 4.66%
handshake_session_id_ring_1.3_rsa_aes 6.89 ms 6.86 ms -0.03 ms (-0.50%) 1.00%
transfer_no_resume_ring_1.2_rsa_aes 6.75 ms 6.79 ms 0.03 ms (0.49%) 4.67%
handshake_tickets_ring_1.3_ecdsap256_chacha 6.41 ms 6.38 ms -0.03 ms (-0.45%) 1.05%
transfer_no_resume_aws_lc_rs_1.3_rsa_chacha 13.61 ms 13.67 ms 0.06 ms (0.44%) 2.67%
transfer_no_resume_ring_1.3_rsa_aes 6.82 ms 6.85 ms 0.03 ms (0.41%) 4.94%
handshake_tickets_ring_1.3_rsa_chacha 6.90 ms 6.87 ms -0.03 ms (-0.41%) 1.00%
handshake_session_id_ring_1.3_ecdsap256_aes 6.39 ms 6.36 ms -0.03 ms (-0.40%) 1.00%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_chacha 456.44 µs 458.25 µs 1.81 µs (0.40%) 4.81%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_aes 457.69 µs 459.49 µs 1.79 µs (0.39%) 4.78%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_aes 4.54 ms 4.52 ms -0.02 ms (-0.39%) 1.12%
handshake_tickets_ring_1.3_ecdsap384_aes 9.56 ms 9.52 ms -0.04 ms (-0.37%) 1.00%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_aes 4.35 ms 4.33 ms -0.02 ms (-0.37%) 1.25%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_aes 5.24 ms 5.22 ms -0.02 ms (-0.34%) 1.19%
handshake_tickets_ring_1.3_ecdsap384_chacha 9.51 ms 9.47 ms -0.03 ms (-0.34%) 1.00%
handshake_session_id_ring_1.3_rsa_chacha 6.83 ms 6.81 ms -0.02 ms (-0.33%) 1.00%
transfer_no_resume_ring_1.3_ecdsap384_aes 9.43 ms 9.46 ms 0.03 ms (0.33%) 2.81%
handshake_session_id_ring_1.3_ecdsap384_aes 9.49 ms 9.46 ms -0.03 ms (-0.33%) 1.00%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_chacha 13.64 ms 13.68 ms 0.04 ms (0.31%) 2.19%
transfer_no_resume_ring_1.3_ecdsap256_chacha 12.97 ms 13.01 ms 0.04 ms (0.30%) 2.44%
handshake_session_id_aws_lc_rs_1.3_rsa_chacha 4.98 ms 4.97 ms -0.01 ms (-0.30%) 1.04%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_aes 5.05 ms 5.03 ms -0.02 ms (-0.30%) 1.40%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_chacha 12.94 ms 12.98 ms 0.04 ms (0.29%) 2.57%
transfer_no_resume_ring_1.3_rsa_chacha 13.47 ms 13.51 ms 0.04 ms (0.27%) 2.72%
handshake_session_id_ring_1.3_ecdsap256_chacha 6.33 ms 6.32 ms -0.02 ms (-0.26%) 1.15%
transfer_no_resume_ring_1.3_ecdsap384_chacha 16.07 ms 16.11 ms 0.04 ms (0.24%) 1.78%
handshake_tickets_aws_lc_rs_1.3_rsa_aes 5.19 ms 5.20 ms 0.01 ms (0.22%) 1.04%
handshake_tickets_aws_lc_rs_1.3_rsa_chacha 5.18 ms 5.17 ms -0.01 ms (-0.20%) 1.08%
handshake_session_id_ring_1.3_ecdsap384_chacha 9.43 ms 9.42 ms -0.02 ms (-0.16%) 1.00%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_aes 1.16 ms 1.16 ms 0.00 ms (0.14%) 1.52%
handshake_no_resume_ring_1.3_ecdsap256_aes 504.90 µs 505.50 µs 0.60 µs (0.12%) 3.72%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_chacha 1.15 ms 1.15 ms 0.00 ms (0.11%) 1.97%
handshake_no_resume_ring_1.3_rsa_aes 994.44 µs 995.30 µs 0.85 µs (0.09%) 1.64%
handshake_no_resume_ring_1.3_ecdsap384_chacha 3.60 ms 3.61 ms 0.00 ms (0.08%) 1.00%
handshake_session_id_aws_lc_rs_1.3_rsa_aes 5.01 ms 5.01 ms 0.00 ms (0.06%) 1.01%
handshake_session_id_ring_1.2_rsa_aes 1.52 ms 1.52 ms -0.00 ms (-0.06%) 1.00%
handshake_no_resume_ring_1.2_rsa_aes 992.17 µs 992.69 µs 0.52 µs (0.05%) 1.75%
handshake_no_resume_ring_1.3_rsa_chacha 994.96 µs 995.31 µs 0.35 µs (0.04%) 1.90%
handshake_no_resume_ring_1.3_ecdsap256_chacha 502.27 µs 502.37 µs 0.11 µs (0.02%) 4.26%
handshake_no_resume_ring_1.3_ecdsap384_aes 3.61 ms 3.61 ms 0.00 ms (0.00%) 1.00%

Additional information

Historical results

Checkout details:

@goffrie

goffrie commented Jan 24, 2025

Copy link
Copy Markdown
Contributor Author

I'm not sure if I should be worried about the benchmark results - it looks like it could just be random variation? I don't really see how this change could lead to a regression but only in two random handshake tests

@cpu cpu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! This is nice and tidy ✨

I'm not sure if I should be worried about the benchmark results - it looks like it could just be random variation?

I think it's safe to ignore here.

@ctz ctz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@ctz
ctz added this pull request to the merge queue Jan 27, 2025
Merged via the queue into rustls:main with commit f9d3c53 Jan 27, 2025
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.

4 participants