Skip to content

Conversation

@Shourya742
Copy link
Collaborator

@Shourya742 Shourya742 commented Jan 19, 2026

closes: #2059

@Shourya742 Shourya742 force-pushed the 2026-01-19-add-benches-for-framing branch 3 times, most recently from 479bbcc to 224f312 Compare January 26, 2026 07:50
@Shourya742 Shourya742 marked this pull request as ready for review January 26, 2026 07:55
@Shourya742 Shourya742 requested a review from GitGab19 January 26, 2026 07:55
///
/// The calculated length includes the full payload length and any additional space required
/// for the MACs.
#[allow(clippy::manual_div_ceil)]
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

@Shourya742 Shourya742 force-pushed the 2026-01-19-add-benches-for-framing branch from 224f312 to c424245 Compare January 28, 2026 17:20
@Shourya742 Shourya742 force-pushed the 2026-01-19-add-benches-for-framing branch from c424245 to afc99d7 Compare January 28, 2026 17:21

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())
Copy link
Collaborator

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],
Copy link
Collaborator

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()?

Suggested change
_a: vec![2u8; size],
_a: payload(size),

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.

Benchmark framing-sv2

2 participants