-
Notifications
You must be signed in to change notification settings - Fork 596
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
perf(array): optimize performance of literal expression #6877
Conversation
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
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.
🚀
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.
Great Job, LGTM!
- How should use the
append_n
in executor (e.g. build a chunk) or is it only for bench? Usually we do not how many values are the same before. - I saw perf(expr): add initial microbenchmark for expressions #6856 has mentioned some potential improvements. Are all kinds of improvements has been includeded in this pr or there is more?
Signed-off-by: Runji Wang <wangrunji0408@163.com>
350ns? |
Sure. Thanks for pointing it out. 🥵 |
It is a method in
Yes, that's all. |
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Although we demonstrated that we can improve the i32 add performance possibly by vectorizing each of the steps (null check, arithmetic and check overflow), can I ask whether any benchmark demonstrates improvement due to the use of I guess the intention is simply to provide an additional method that we can benchmark the usage of in the future? |
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Sure. The bench "expr/constant" (literal expression). Previously it could only append the same value one by one. Now it can append them all at once. |
Codecov Report
@@ Coverage Diff @@
## main #6877 +/- ##
==========================================
- Coverage 73.16% 73.15% -0.02%
==========================================
Files 1033 1033
Lines 164925 165019 +94
==========================================
+ Hits 120665 120714 +49
- Misses 44260 44305 +45
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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!!!
Signed-off-by: Runji Wang <wangrunji0408@163.com>
I hereby agree to the terms of the Singularity Data, Inc. Contributor License Agreement.
What's changed and what's your intention?
Array::raw_iter
to efficiently iterate over raw values regardless of null.ArrayBuilder::append_n
to efficiently append the same value multiple times.head
fromBitmap
With these optimizations, the evaluation time of literal expressions dropped from 2.2us to 150ns.
This PR also adds an optimized version of
i32 + i32
using raw iterator in the bench, reducing time from 3.3us to 350ns.Checklist
./risedev check
(or alias,./risedev c
)Refer to a related PR or issue link (optional)
#6868