-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Enhancement] Use nibble mask in filter_range for ARM #44194
Merged
Merged
Conversation
This file contains 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
Signed-off-by: zihe.liu <ziheliu1024@gmail.com>
Signed-off-by: zihe.liu <ziheliu1024@gmail.com>
Signed-off-by: zihe.liu <ziheliu1024@gmail.com>
78aaf7c
to
597eebd
Compare
dirtysalt
approved these changes
Apr 16, 2024
[FE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[BE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
kangkaisen
approved these changes
Apr 17, 2024
stdpain
approved these changes
Apr 17, 2024
leiyang0324
pushed a commit
to leiyang0324/starrocks
that referenced
this pull request
Apr 19, 2024
Signed-off-by: zihe.liu <ziheliu1024@gmail.com>
ZiheLiu
added a commit
to ZiheLiu/starrocks
that referenced
this pull request
Apr 25, 2024
Signed-off-by: zihe.liu <ziheliu1024@gmail.com>
@mergify backport branch-3.2 branch-3.3 |
✅ Backports have been created
|
mergify bot
pushed a commit
that referenced
this pull request
Apr 26, 2024
Signed-off-by: zihe.liu <ziheliu1024@gmail.com> (cherry picked from commit 6326aa0)
mergify bot
pushed a commit
that referenced
this pull request
Apr 26, 2024
Signed-off-by: zihe.liu <ziheliu1024@gmail.com> (cherry picked from commit 6326aa0)
This was referenced Apr 26, 2024
wanpengfei-git
pushed a commit
that referenced
this pull request
Apr 26, 2024
… (#44818) Co-authored-by: zihe.liu <ziheliu1024@gmail.com>
kangkaisen
pushed a commit
that referenced
this pull request
Apr 26, 2024
… (#44819) Co-authored-by: zihe.liu <ziheliu1024@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why I'm doing:
Optimize
filter_range
for ARM.Here is the CPU perf flame graph for the SSB 100GB Q07. The occupation of
FixedLengthColumnBase<int>::filter_range
increases from 11.35% on x86 to 19.27% on ARM.Q07 is special, because almost every chunk keeps several rows after filtering. Therefore, the third branch always hit by every chunk.
on ARM
![Q07 perf arm](https://private-user-images.githubusercontent.com/13313784/322872372-63ae01f1-79a3-4614-8c02-31bc8f797ea1.svg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ1NDM2OTIsIm5iZiI6MTcyNDU0MzM5MiwicGF0aCI6Ii8xMzMxMzc4NC8zMjI4NzIzNzItNjNhZTAxZjEtNzlhMy00NjE0LThjMDItMzFiYzhmNzk3ZWExLnN2Zz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI0VDIzNDk1MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY5NTZjNjUyOWQ3Njk5NDc1NjA5ZGE4NTc2ZGZlODk3ZDM0ZDIwMTI3YzA1NjFkZDY5OWY5YzZjYWIyN2I4OWEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.U9QV1IloOPLB7wCGl_-GUMuGkBdMm7zbjlgfYLZCDUk)
on x86
![Q07 perf x86](https://private-user-images.githubusercontent.com/13313784/322872405-d8818f5d-ef84-4f26-b0fd-24064ad64a5b.svg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ1NDM2OTIsIm5iZiI6MTcyNDU0MzM5MiwicGF0aCI6Ii8xMzMxMzc4NC8zMjI4NzI0MDUtZDg4MThmNWQtZWY4NC00ZjI2LWIwZmQtMjQwNjRhZDY0YTViLnN2Zz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI0VDIzNDk1MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWUzM2I1YTNlNGQ3ZjQxNWY1YThlNTMxZDhhYWRhNjEyOWNlZGVkYWJjNDRhNzE0ZTBhNDk2Y2ZjY2I3YzI1YzYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.a4Cil7YmBvd7etKb0nerTWeLbKTYJ5tNyG7sIy635ro)
What I'm doing:
Inspired by this article, we could get a nibble mask for the filter result, which is a 64-bit mask, each 4-bit represents a byte of the input.
And then we could use
x &= (x - 1)
and__builtin_ctzll
to iterate through bits to eliminateif
branch, which referred to as Kernighan's algorithm.Test
Enviroment
Test Result
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: