-
-
Couldn't load subscription status.
- Fork 5.7k
speedup BitSet iteration (by 2x or 3x) #33690
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
Conversation
74bb775 to
6f6cc5f
Compare
|
Consider using the same algorithm as logical indexing, for a further ~40% speedup: Reason for this is that On my machine: |
|
Wow amazing! Actually, I thought that So in your example you still compute
For those wondering, this is the EDIT: actually, keeping |
|
Looks like we do have some BitSet perf tests in the @nanosoldier |
|
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan |
|
Would be good to add a benchmark for this. |
|
We just need to actually iterate over the entire container to see any advantage. The current tests just do it once twice. |
Cf. https://discourse.julialang.org/t/iterate-and-intersect-on-bitset-vs-int/30345/5 for motivation.
A shorter (stupid) benchmark:
Master:
PR:
EDIT: PR with
_blsr:This is a speedup of about 2.6x forb1andb2, and almost 3x forb3.This is a speedup of about 6x.