-
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
Storages: Use std::vector<UInt8> in BitmapFilter #9552
Conversation
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.
@JinheLin I have pushed a commit to refine other functions and fixed the build of bench_dbms
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: JaySon-Huang, Lloyd-Pottiger 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 |
[LGTM Timeline notifier]Timeline:
|
build failure:
|
What problem does this PR solve?
Issue Number: ref #6834
Problem Summary:
std::vector<bool>
is slower thanstd::vector<UInt8>
in most cases, because it cannot be vectorized.What is changed and how it works?
Benchmark results of
std::vector<bool>
andstd::vector<UInt8>
:Only in the case of
bitmapSetRowID*
thatvector<UInt8>
is slightly slower thanvector<bool>
.vector<bool>
is about 1.2 times faster thanvector<UInt8>
.std::vector<UInt8>
cannot be vectorized by the compiler since the memory access is discrete.vector<bool>
is smaller thanvector<UInt8>
, so it is more cache friendly.In
bitmapAnd*
,vector<UInt8>
is more than 31 times faster thanvector<bool>
.In
bitmapSetRange*
,vector<UInt8>
is more than 17 times faster thanvector<bool>
.In
bitmapGetRange*
,vector<UInt8>
is more than 254 times faster thanvector<bool>
.Memory usage of
vector<UInt8>
is 8 times higher thanvector<bool>
. But only about 1MB for a segment with 1 million rows, I think it is acceptable.Test results of a certain PoC:
vector<bool>
vector<UInt8>
Check List
Tests
Side effects
Documentation
Release note