-
Notifications
You must be signed in to change notification settings - Fork 746
bench: increase benchmark throughput data size #5587
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
base: main
Are you sure you want to change the base?
Conversation
| 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) |
There was a problem hiding this comment.
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
| 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]; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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.