You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "ZhangYu0123 (via GitHub)" <gi...@apache.org> on 2023/04/03 22:08:48 UTC
[GitHub] [doris] ZhangYu0123 commented on a diff in pull request #18321: [Optimization](string) optimize constant empty string compare ( column='', column!='')
ZhangYu0123 commented on code in PR #18321:
URL: https://github.com/apache/doris/pull/18321#discussion_r1156499051
##########
be/src/vec/functions/functions_comparison.h:
##########
@@ -211,15 +211,28 @@ struct StringEqualsImpl {
ColumnString::Offset b_size,
PaddedPODArray<UInt8>& c) {
size_t size = a_offsets.size();
- ColumnString::Offset prev_a_offset = 0;
-
- for (size_t i = 0; i < size; ++i) {
- auto a_size = a_offsets[i] - prev_a_offset;
-
- c[i] = positive == memequal_small_allow_overflow15(a_data.data() + prev_a_offset,
- a_size, b_data.data(), b_size);
-
- prev_a_offset = a_offsets[i];
+ if (b_size == 0) {
+ auto* __restrict data = c.data();
+ auto* __restrict offsets = a_offsets.data();
+ if (positive) {
+ for (size_t i = 0; i < size; ++i) {
+ data[i] = (offsets[i] == offsets[i - 1]);
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org