Skip to content
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

Merged
merged 2 commits into from
Sep 5, 2024

Conversation

kazuyukitanimura
Copy link
Contributor

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

@kazuyukitanimura kazuyukitanimura marked this pull request as ready for review September 3, 2024 19:37
@kazuyukitanimura
Copy link
Contributor Author

cc @alamb

Copy link
Member

@andygrove andygrove left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @kazuyukitanimura

@kazuyukitanimura
Copy link
Contributor Author

kazuyukitanimura commented Sep 4, 2024

@alamb when you have a chance, feedbacks would be appreciated!

Copy link
Contributor

@alamb alamb left a 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);
Copy link
Contributor

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.

@alamb alamb merged commit 1e63281 into apache:master Sep 5, 2024
26 checks passed
@kazuyukitanimura
Copy link
Contributor Author

Thank you @andygrove @alamb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants