wangbo commented on a change in pull request #7795: URL: https://github.com/apache/incubator-doris/pull/7795#discussion_r786808199
########## File path: be/src/olap/rowset/segment_v2/segment_iterator.cpp ########## @@ -807,10 +809,31 @@ void SegmentIterator::_evaluate_vectorization_predicate(uint16_t* sel_rowid_idx, bool ret_flags[selected_size]; memset(ret_flags, 1, selected_size); _pre_eval_block_predicate->evaluate_vec(_current_return_columns, selected_size, ret_flags); - - for (uint32_t i = 0; i < selected_size; ++i) { - if (ret_flags[i]) { - sel_rowid_idx[new_size++] = i; + + uint32_t sel_pos = 0; + const uint32_t sel_end = sel_pos + selected_size; + static constexpr size_t SIMD_BYTES = 32; + const uint32_t sel_end_simd = sel_pos + selected_size / SIMD_BYTES * SIMD_BYTES; + + while (sel_pos < sel_end_simd) { + auto mask = vectorized::bytes32_mask_to_bits32_mask( + reinterpret_cast<const uint8_t*>(ret_flags + sel_pos)); + if (mask == 0xffffffff) { + memset(sel_rowid_idx + new_size, true, SIMD_BYTES); + new_size += SIMD_BYTES; Review comment: why ```memset(true)``` here? ```sel_rowid_idx``` should be filled rowid here. ```memset(true)``` means you store 257 to ```sel_rowid_idx```. -- 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