Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Added support for bitwise operations #553

Merged
merged 15 commits into from
Oct 31, 2021

Conversation

1aguna
Copy link
Contributor

@1aguna 1aguna commented Oct 27, 2021

Adds bitwise & and, ^ xor, | or, and ! not operators. This PR addresses #469 .

Benchmarks on my machine are a little noisy, especially for the larger sizes, namely 2^20.

My system stats are

32GiB System Memory
384KiB L1 cache
1536KiB L2 cache
12MiB L3 cache
Intel(R) Core(TM) i5-10400 CPU @ 2.90GHz

and here are the benchmarks for 2^20 for reference:

or 2^20                time:   [837.12 us 838.36 us 839.65 us]                     
                        change: [-6.8839% -5.8348% -4.8247%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 5 outliers among 100 measurements (5.00%)
  3 (3.00%) high mild
  2 (2.00%) high severe

xor 2^20                time:   [837.43 us 838.90 us 840.51 us]                     
                        change: [-8.4754% -7.6579% -6.8264%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 7 outliers among 100 measurements (7.00%)
  2 (2.00%) high mild
  5 (5.00%) high severe

and 2^20                time:   [844.41 us 846.36 us 849.01 us]                     
                        change: [-17.143% -14.714% -12.417%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 10 outliers among 100 measurements (10.00%)
  1 (1.00%) low mild
  2 (2.00%) high mild
  7 (7.00%) high severe

not 2^20                time:   [547.10 us 548.25 us 549.55 us]                     
                        change: [-6.8615% -5.9387% -5.0605%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 11 outliers among 100 measurements (11.00%)
  1 (1.00%) low mild
  6 (6.00%) high mild
  4 (4.00%) high severe

@codecov
Copy link

codecov bot commented Oct 27, 2021

Codecov Report

Merging #553 (046ec36) into main (eca8237) will increase coverage by 0.02%.
The diff coverage is 89.74%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #553      +/-   ##
==========================================
+ Coverage   78.93%   78.95%   +0.02%     
==========================================
  Files         382      385       +3     
  Lines       24288    24327      +39     
==========================================
+ Hits        19171    19207      +36     
- Misses       5117     5120       +3     
Impacted Files Coverage Δ
benches/bitwise.rs 0.00% <0.00%> (ø)
src/compute/bitwise.rs 100.00% <100.00%> (ø)
tests/it/compute/bitwise.rs 100.00% <100.00%> (ø)
src/bitmap/utils/slice_iterator.rs 92.53% <0.00%> (+1.49%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eca8237...046ec36. Read the comment docs.

Copy link
Owner

@jorgecarleitao jorgecarleitao left a comment

Choose a reason for hiding this comment

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

Thanks a @1aguna for this. Looks great. Left a small number of suggestions, but it is otherwise ready to go. 👍

benches/bitwise.rs Outdated Show resolved Hide resolved
tests/it/compute/bitwise.rs Outdated Show resolved Hide resolved
tests/it/compute/bitwise.rs Outdated Show resolved Hide resolved
src/compute/bitwise.rs Outdated Show resolved Hide resolved
1aguna and others added 4 commits October 28, 2021 22:02
Co-authored-by: Jorge Leitao <jorgecarleitao@gmail.com>
Co-authored-by: Jorge Leitao <jorgecarleitao@gmail.com>
Co-authored-by: Jorge Leitao <jorgecarleitao@gmail.com>
Co-authored-by: Jorge Leitao <jorgecarleitao@gmail.com>
@1aguna
Copy link
Contributor Author

1aguna commented Oct 29, 2021

Thanks @jorgecarleitao ! I appreciate it 😄

@jorgecarleitao jorgecarleitao added the feature A new feature label Oct 29, 2021
@jorgecarleitao jorgecarleitao changed the title Add bitwise operations Added bitwise operations Oct 29, 2021
@jorgecarleitao
Copy link
Owner

One clippy and a conflict to go. Let me know if you would like me to address them for you.

@1aguna
Copy link
Contributor Author

1aguna commented Oct 30, 2021

Alright I believe I resolved those issues. Hopefully passes the merge checks this time around.

@jorgecarleitao jorgecarleitao merged commit f078351 into jorgecarleitao:main Oct 31, 2021
@jorgecarleitao jorgecarleitao changed the title Added bitwise operations Added support for bitwise operations Nov 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants