-
Notifications
You must be signed in to change notification settings - Fork 259
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
Add intersect_vector16_inplace to enable vectorized inplace intersection between arrays. #445
Add intersect_vector16_inplace to enable vectorized inplace intersection between arrays. #445
Conversation
Running tests. Looks good at a glance!!! |
} else if (b < a) { | ||
i_b++; | ||
} else { | ||
A[count] = a; //==b; |
Check notice
Code scanning / CodeQL
Commented-out code
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.
GitHub complains about commented out code, make sure that you don't need to delete it.
I found this in fuzz/croaring_fuzzer.c. Looks like we need to comment out the first line.
|
1715194
to
ae84013
Compare
@lemire I have rebased this branch to the latest commit, please rerun the tests. |
This was a typo, I fixed it earlier. |
Running tests. |
@lemire Seems that fuzzers won't build. Have you got any idea why? Or does it matter? |
This is a good PR. I am merging it. I will figure out the issue with the fuzzer later. It is unrelated to your code, I expect. |
I notice that in function
array_container_intersection_inplace
, there is no implementation of vectorized inplace intersection, and this slows down the computation.We can simply use intersect_vector16 to do a non-inplace intersection, and replace the source array with the new one, but this requires frequent memory allocation and freeing. So I think a real inplace intersection is better.
Function
intersect_vector16_inplace
is modified fromintersect_vector16
, which uses__m128i tmp[2]
for temporary storage of intersection result, to avoid overwritting original numbers in source array that haven't been used.