-
Notifications
You must be signed in to change notification settings - Fork 828
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
Benchmark for bit_mask (set_bits) #6353
Conversation
cc @alamb |
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.
LGTM. Thanks @kazuyukitanimura
@alamb when you have a chance, feedbacks would be appreciated! |
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 very cool @kazuyukitanimura
I ran it locally
bit_mask/set_bits/offset_write_0_offset_read_0_len_1_datum_0
time: [3.9908 ns 4.0114 ns 4.0375 ns]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high severe
bit_mask/set_bits/offset_write_0_offset_read_0_len_1_datum_173
time: [4.1214 ns 4.1350 ns 4.1481 ns]
bit_mask/set_bits/offset_write_0_offset_read_0_len_17_datum_0
time: [12.735 ns 12.762 ns 12.786 ns]
Found 4 outliers among 100 measurements (4.00%)
3 (3.00%) low mild
1 (1.00%) high mild
Benchmarking bit_mask/set_bits/offset_write_0_offset_read_0_len_17_datum_173: Collecting 100 samples in estimated 5.0000 s (324M iterations
bit_mask/set_bits/offset_write_0_offset_read_0_len_17_datum_173
time: [15.578 ns 15.635 ns 15.693 ns]
...
And looks 👍
Thank you @andygrove for the review
for offset_read in [0, 5] { | ||
for len in [1, 17, 65] { | ||
for datum in [0u8, 0xADu8] { | ||
let x = (offset_write, offset_read, len, datum); |
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.
I personally found the masking / packing of these fields into x
a little hard to read (as I had to maintain a mental mapping that x.2
meant len
)
I would have personally found it easier to understand if they were named fields of a struct or maybe just passed by copy.
Thank you @andygrove @alamb |
Which issue does this PR close?
Rationale for this change
Per #6288 (comment)
What changes are included in this PR?
Added the benchmark for bit_mask (set_bits)
Are there any user-facing changes?
No