Enhance performance of rz_bv_copy_nbits
and rz_bv_set_range
#4716
Labels
enhancement
New feature or request
good first issue
Good for newcomers
performance
A performance problem/enhancement
RzUtil
Is your feature request related to a problem? Please describe.
Performance could be better and we save energy which would make us better humans.
Describe the solution you'd like
Both functions do something like this:
At least if we deal with small bit vectors (
<= 64bit
) we could do this with shift, AND + OR.This would save a bunch of calls and other shifts and ORs.
For larger bit vectors we could check if the range is large enough (e.g. 8 bits or more).
Then set the first bits until the rest of them is aligned to a multiple of a byte (for
RzBitVector->large_a
) and assign the rest of them viamemcopy
.Describe alternatives you've considered
None really.
Additional context
This would give us quite some computation back. In my use case this loop consumes around 2.3%.
I also think this is a required improvement before we merge resource intensive analysis algorithms based on it.
The text was updated successfully, but these errors were encountered: