Skip to content
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

Rz bv copy #4739

Closed
wants to merge 3 commits into from
Closed

Rz bv copy #4739

wants to merge 3 commits into from

Conversation

rajRishi22
Copy link

Your checklist for this pull request

  • I've read the guidelines for contributing to this repository
  • I made sure to follow the project's coding style
  • I've documented or updated the documentation of every function and struct this PR changes. If not so I've explained why.
  • I've added tests that prove my fix is effective or that my feature works (if possible)
  • I've updated the rizin book with the relevant information (if needed)

Detailed description

Detailed description
This pull request optimizes the performance of the rz_bv_set_range function. The original implementation iterated through bits one at a time, leading to inefficiencies for large ranges. The updated implementation:

Processes aligned chunks of bits using system word size for faster operations.
Dynamically adjusts chunk size for different architectures (e.g., 32-bit, 64-bit).
Handles unaligned prefix and suffix bits separately while optimizing the main loop.
Adds robust boundary validation to ensure correctness.
This change reduces iteration overhead and improves performance while maintaining compatibility and correctness.
...

Test plan

  1. Verify functionality for small ranges, large ranges, and edge cases (unaligned ranges).
  2. Test on various architectures to confirm portability (32-bit, 64-bit).
  3. Use unit tests to ensure the results match the original functionality.
  4. Check for any regressions with existing test suites.
    ...

Closing issues
Closes #4716

...

@rajRishi22 rajRishi22 closed this Nov 25, 2024
@rajRishi22 rajRishi22 deleted the rz_bv_copy branch November 25, 2024 09:18
@rajRishi22 rajRishi22 restored the rz_bv_copy branch November 25, 2024 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhance performance of rz_bv_copy_nbits and rz_bv_set_range
1 participant