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

Improved performance of boolean comparison (5x-14x) #318

Merged
merged 2 commits into from
Aug 23, 2021
Merged

Conversation

jorgecarleitao
Copy link
Owner

@jorgecarleitao jorgecarleitao commented Aug 22, 2021

The idea is that we can compare full bytes instead of iterating over individual bits, replacing Fn(bool,bool) -> bool by Fn(u8,u8) -> u8 with corresponding bit operations (e.g. a != b -> a ^ b, a < b -> !a & b).

git checkout 0893100640f22dfc5fec4dede300f63fe095b170
cargo bench --no-default-features --features benchmarks,compute --bench comparison_kernels -- "bool.*2\^20"
git checkout cmp_boolean
cargo bench --no-default-features --features benchmarks,compute --bench comparison_kernels -- "bool.*2\^20"
bool 2^20               time:   [1.0651 ms 1.0719 ms 1.0817 ms]                       
                        change: [-78.884% -78.378% -77.783%] (p = 0.00 < 0.05)

bool scalar 2^20        time:   [212.37 us 213.76 us 215.72 us]                             
                        change: [-93.123% -93.040% -92.965%] (p = 0.00 < 0.05)

@jorgecarleitao jorgecarleitao added the enhancement An improvement to an existing feature label Aug 22, 2021
@codecov
Copy link

codecov bot commented Aug 22, 2021

Codecov Report

Merging #318 (8ba79ff) into main (8243861) will increase coverage by 0.01%.
The diff coverage is 85.18%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #318      +/-   ##
==========================================
+ Coverage   80.52%   80.54%   +0.01%     
==========================================
  Files         324      324              
  Lines       21369    21383      +14     
==========================================
+ Hits        17208    17222      +14     
  Misses       4161     4161              
Impacted Files Coverage Δ
src/compute/comparison/boolean.rs 69.14% <85.18%> (+5.39%) ⬆️

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 8243861...8ba79ff. Read the comment docs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement An improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant