-
Notifications
You must be signed in to change notification settings - Fork 411
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
Compression: support FOR & replace Delta with DeltaFOR #8983
Conversation
1165f87
to
c2930dd
Compare
c2930dd
to
96230de
Compare
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.
lgtm
3545c0d
to
6e0840d
Compare
// store frame of reference | ||
unalignedStore<T>(dest, frame_of_reference); | ||
dest += sizeof(T); | ||
if (frame_of_reference != 0) |
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.
What if frame_of_reference
is negative?
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.
T can only be an unsigned type, frame_of_reference
can not be negative.
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.
Now we support signed types, but here is just an optimization, when frame_of_reference
= 0, no need to do minus.
And for signed types, there is no need to consider overflow, because
int count = std::numeric_limits<int>::min();
count -= std::numeric_limits<int>::max();
count += std::numeric_limits<int>::max();
std::cout << count << "\n"; // equal to std::numeric_limits<int>::min()
Signed-off-by: Lloyd-Pottiger <[email protected]>
Signed-off-by: Lloyd-Pottiger <[email protected]>
Signed-off-by: Lloyd-Pottiger <[email protected]>
Signed-off-by: Lloyd-Pottiger <[email protected]>
Signed-off-by: Lloyd-Pottiger <[email protected]>
Signed-off-by: Lloyd-Pottiger <[email protected]>
Signed-off-by: Lloyd-Pottiger <[email protected]>
Signed-off-by: Lloyd-Pottiger <[email protected]>
Co-authored-by: jinhelin <[email protected]>
Signed-off-by: Lloyd-Pottiger <[email protected]>
/hold |
for (; i < misaligned_count; ++i) | ||
{ | ||
dst[i] += frame_of_reference; | ||
} |
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 doing this for loop after the for (; i < count; i += (sizeof(__m256i) / sizeof(T)))
can bring better performance. Because we can assume the memory address of dst + 0
should be aligned with the cache line, but it is not always aligned when it starts with dst + misaligned_count
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.
Good catch, fixed.
Signed-off-by: Lloyd-Pottiger <[email protected]>
Signed-off-by: Lloyd-Pottiger <[email protected]>
Signed-off-by: Lloyd-Pottiger <[email protected]>
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.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: CalvinNeo, JaySon-Huang, JinheLin The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/unhold |
What problem does this PR solve?
Issue Number: ref #8982
Problem Summary:
What is changed and how it works?
FOR: https://dbms-arch.fandom.com/wiki/Frame_of_Reference_(Compression_Scheme)
Delta is not a compression algorithm, but Delta + FOR be.
Check List
Tests
Side effects
Documentation
Release note