-
-
Notifications
You must be signed in to change notification settings - Fork 478
Bitvector in-place refactor #5569
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
|
fyi @antonangeloff |
This comment was marked as outdated.
This comment was marked as outdated.
|
Looks good! BTW doesn't |
Yes, I wanted API consistency. As you see it uses the "not-inplace" function. So both are tested nonetheless. |
notxvilka
left a comment
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.
While you are on it, could you please extend the bench to test also inplace functions? Would be interesting to compare the actual results.
| ut32 j = 2; | ||
| for (ut32 i = 0; i < bv->_elem_len; i++) { | ||
| ut8 b8 = bv->bits.large_a[bv->_elem_len - i - 1]; | ||
| ut32 n_elem = NELEM(bv->len, BV_ELEM_SIZE); |
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.
make it const if doesn't change.
wargio
left a comment
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.
overall seems a nice improvement.
For what it's worth - from API perspective there seems to be 2 functions doing the same thing, and also the function If you think it makes sense |
|
@notxvilka Here are the benchmark results of the So something around 20-25%. Generally I'd like to see the analysis of a BB happen mostly in cache. Accessing RAM only for IO reads/writes or lifting of rarely used instructions. I did run some |
Your checklist for this pull request
RZ_APIfunction and struct this PR changes.RZ_API).Detailed description
Refactors multiple bit vector operations to work in place.
This is helpful for hot paths which don't want to allocate a new bit vector with each operation on them.
Test plan
Added
Closing issues
...