Skip to content

fix(benches): reuse config for handshakes #5319

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

Merged
merged 4 commits into from
May 27, 2025

Conversation

jmayclin
Copy link
Contributor

Description of changes:

We noticed some odd benchmark results from the recent change: #5305 . Notably the benchmark caused the performance of rustls and openssl handshakes to significantly degrade on RSA certs.

This change was ultimately the result of switching to a fresh config for each handshake. This is because the libcrypto EVP_PKEY rsa key will cache/precompute certain parts of the sign operation. This causes the first sign to be slower, later signs to be faster. In TLS, this causes the first handshake to be slower, and subsequent handshakes to be faster.

This PR changes the benchmarking setup to reuse the config across the measured handshakes, as that is a more "customer similar" environment.

Testing:

I remove the pkey_match implementation and observed the same handshake regression in s2n-tls.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions github-actions bot added the s2n-core team label May 21, 2025
@jmayclin jmayclin requested review from goatgoose and maddeleine May 21, 2025 00:48
Copy link
Contributor

@maddeleine maddeleine left a comment

Choose a reason for hiding this comment

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

Did you want to get the CI passing before we review? Probably the benchmarking test should pass.

- odd interaction of setup with shared configs
@jmayclin jmayclin requested a review from maddeleine May 23, 2025 02:55
Co-authored-by: Sam Clark <[email protected]>
@jmayclin jmayclin added this pull request to the merge queue May 27, 2025
Merged via the queue into aws:main with commit f1e6e0d May 27, 2025
47 checks passed
@jmayclin jmayclin deleted the bench-reuse-config branch May 27, 2025 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants