Skip to content

Conversation

@kaukabrizvi
Copy link
Contributor

@kaukabrizvi kaukabrizvi commented Oct 27, 2025

Goal:
Increase throughput test size from 100 KB to 10 MB for more representative benchmarking.

Why:
To smooth out graphs in the Ops dashboard.

How:
Expanded shared buffer size and moved allocation to the heap to prevent stack overflow.

Testing:
Validated locally via cargo bench; all benchmarks passed.

Next Steps:
Update the Ops dashboard scale and documentation to reflect the new throughput size.

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 Oct 27, 2025
@kaukabrizvi kaukabrizvi changed the title bench: Increase benchmark throughput data size bench: increase benchmark throughput data size Oct 27, 2025
@kaukabrizvi kaukabrizvi marked this pull request as ready for review October 27, 2025 21:57
pub fn bench_throughput_cipher_suites(c: &mut Criterion) {
// arbitrarily large to cut across TLS record boundaries
let mut shared_buf = [0u8; 100000];
let mut shared_buf = vec![0u8; 10_000_000]; // 10MB (allocated on the heap to avoid stack overflow)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: let's move this to a top-level comment instead of having both top-level comment and inline comment describing the same line

@kaukabrizvi kaukabrizvi requested a review from jouho October 28, 2025 17:44
Comment on lines 45 to +47
pub fn bench_throughput_cipher_suites(c: &mut Criterion) {
// arbitrarily large to cut across TLS record boundaries
let mut shared_buf = [0u8; 100000];
// 10MB buffer - arbitrarily large to cut across TLS record boundaries.
let mut shared_buf = vec![0u8; 10_000_000];
Copy link
Contributor

@lrstewart lrstewart Oct 28, 2025

Choose a reason for hiding this comment

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

Is this the right 10MB? I'm not super familiar with the benchmark tests, and I also see

let mut buf = [0x56u8; 1000000];

Did you just test that all benchmarks passed, or did you somehow confirm that all benchmark tests now send more data / take longer? Can you expand your "Testing" section with more details about how you know this change achieves what you're trying to achieve?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the right 10 MB to configure buffer size for throughput benchmarks. To address the second point, I inspected the benchmark results more closely and found that s2n-tls performs significantly faster than expected at 10 MB. I'm currently exploring this and will follow up once I've gathered sufficient data and have more clarity on this behavior.

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