Skip to content

Add benchmarks of 'write_[u]int[128]'#206

Open
fintelia wants to merge 1 commit intoBurntSushi:masterfrom
fintelia:add-bench-bb
Open

Add benchmarks of 'write_[u]int[128]'#206
fintelia wants to merge 1 commit intoBurntSushi:masterfrom
fintelia:add-bench-bb

Conversation

@fintelia
Copy link
Copy Markdown
Contributor

@fintelia fintelia commented Apr 2, 2024

This adds benchmarks of other crate methods that previously weren't benchmarked.

Comment thread benches/bench.rs
b.iter(|| {
for _ in 0..NITER {
bb(BigEndian::$read(&buf, $bytes));
bb(BigEndian::$read(&buf, bb($bytes)));
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not sure whether the $bytes input should be wrapped in black_box, but I noticed it has a huge impact on performance, so I figured I'd mention it

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Hmmm I don't think so. But I'm honestly not sure. I'd have to see a minimal reproducible example and compare codegen I think.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I think I would defer to the status quo for now.

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.

2 participants