-
Notifications
You must be signed in to change notification settings - Fork 180
Add framing benches #2051
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?
Add framing benches #2051
Conversation
479bbcc to
224f312
Compare
| /// | ||
| /// The calculated length includes the full payload length and any additional space required | ||
| /// for the MACs. | ||
| #[allow(clippy::manual_div_ceil)] |
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.
Why not use div_ceil?
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.
on my machine div_ceil was quite slow compared to current version.
224f312 to
c424245
Compare
c424245 to
afc99d7
Compare
|
|
||
| for &size in PAYLOAD_SIZES { | ||
| group.bench_with_input(BenchmarkId::from_parameter(size), &size, |b, _| { | ||
| b.iter(|| Sv2Frame::<Vec<u8>, _>::from_bytes(black_box(payload(size))).unwrap()) |
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.
aren't we also computing the time for the payload() to create the vec? Shoudn't we compute the payload()outside of the iter()?
|
|
||
| fn tester(size: usize) -> Tester { | ||
| Tester { | ||
| _a: vec![2u8; size], |
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.
shoudn't this be using payload()?
| _a: vec![2u8; size], | |
| _a: payload(size), |
closes: #2059