-
Notifications
You must be signed in to change notification settings - Fork 1k
Add Buffer::from_bitwise_unary and Buffer::from_bitwise_binary me…
#8854
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
base: main
Are you sure you want to change the base?
Conversation
3c68505 to
69e68a1
Compare
…thods, deprecate old methods
69e68a1 to
d5a3604
Compare
|
🤖 |
|
🤖: Benchmark completed Details
|
|
🤖 |
|
🤖: Benchmark completed Details
|
|
🤖 |
|
🤖: Benchmark completed Details
|
|
🤖 |
|
🤖: Benchmark completed Details
|
…thods, deprecate old methods
Which issue does this PR close?
Rationale for this change
bitwise_bin_op_helper and bitwise_unary_op_helper are somewhat hard to find and use
as explained on WIP: special case bitwise ops when buffers are u64 aligned #8807
I want to optimize bitwise operations even more heavily (see WIP: special case bitwise ops when buffers are u64 aligned #8807) so I want the implementations centralized so I can focus the efforts there
Also, I think these APIs I think cover the usecase explained by @jorstmann on #8561:
By creating a method on Buffer directly, it is easier to find, and it is clearer that
a new Buffer is being created.
What changes are included in this PR?
Changes:
Buffer::from_bitwise_unaryandBuffer::from_bitwise_binarymethods that do the same thing asbitwise_unary_op_helperandbitwise_bin_op_helperbut are easier to find and usebitwise_unary_op_helperandbitwise_bin_op_helperin favorof the new Buffer methods
operate on bits, not bytes and shouldn't do any cross byte operations)
Are these changes tested?
Yes, new doc tests
Are there any user-facing changes?
New APIs, some deprecated