HappenLee commented on code in PR #18321: URL: https://github.com/apache/doris/pull/18321#discussion_r1155789374
########## 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: `data[i] = positive ? (offsets[i] == offsets[i - 1]) : (offsets[i] != offsets[i - 1]);` The code can auto simd -- 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-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org