-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Optimize boolean operations #9284
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
Draft
Dandandan
wants to merge
23
commits into
apache:main
Choose a base branch
from
Dandandan:optimize_unaligned_bitchunk_iterator
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
b4b71aa
Optimize UnalignedBitChunk
Dandandan af1cdf2
Fix documentation typo in chunks iterator
Dandandan 15ad389
Use chain again
Dandandan e36e535
Specialize fold
Dandandan 2dce86d
WIP
Dandandan 72a9632
WIP
Dandandan e2e31cc
WIP
Dandandan 6d95314
WIP
Dandandan d8a6aac
WIP
Dandandan 00d36c0
WIP
Dandandan 9acd3a8
WIP
Dandandan 0d425e4
Remove truncation
Dandandan 8ee0302
WIP
Dandandan fea9537
WIP
Dandandan 59248b2
WIP
Dandandan 060afb8
WIP
Dandandan 8c436fc
Implement bitwise using u64 align
Dandandan 64edc39
Implement bitwise using u64 align
Dandandan 50f0100
Revert "Implement bitwise using u64 align"
Dandandan 5f2ffbc
Revert "Implement bitwise using u64 align"
Dandandan 88481e5
Clippy
Dandandan ac9ab26
Simplify from_bitwise_unary_op to use chunks_exact always
Dandandan 1d307cb
Simplify from_bitwise_unary_op to use chunks_exact always
Dandandan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -872,15 +872,16 @@ impl MutableBuffer { | |
|
|
||
| let mut buffer = MutableBuffer::new(len); | ||
|
|
||
| let mut dst = buffer.data.as_ptr(); | ||
| for item in iterator { | ||
| let mut dst = buffer.data.as_ptr() as *mut T; | ||
| iterator.for_each(|item| { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| // note how there is no reserve here (compared with `extend_from_iter`) | ||
| let src = item.to_byte_slice().as_ptr(); | ||
| unsafe { std::ptr::copy_nonoverlapping(src, dst, item_size) }; | ||
| dst = unsafe { dst.add(item_size) }; | ||
| } | ||
| unsafe { | ||
| std::ptr::write(dst, item); | ||
| dst = dst.add(1); | ||
| } | ||
| }); | ||
| assert_eq!( | ||
| unsafe { dst.offset_from(buffer.data.as_ptr()) } as usize, | ||
| unsafe { (dst as *mut u8).offset_from(buffer.data.as_ptr()) } as usize, | ||
| len, | ||
| "Trusted iterator length was not accurately reported" | ||
| ); | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think we actually don't have to use this part (use the byte aligned one above and set the correct offset).