enhance: Use bitset or instead of bitwise set (#39037)

Related to #39003

Copying bitset value bit by bit is slow and CPU heavy, this PR utilizes
bitset operator "|=" to accelerate this procedure

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/39106/head
congqixia 2025-01-07 15:02:56 +08:00 committed by GitHub
parent 84f8047a86
commit 182cac03e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 3 deletions

View File

@ -223,9 +223,10 @@ PhyTermFilterExpr::ExecPkTermImpl() {
TargetBitmapView valid_res(res_vec->GetValidRawData(), real_batch_size);
valid_res.set();
for (size_t i = 0; i < real_batch_size; ++i) {
res[i] = cached_bits_[current_data_chunk_pos_++];
}
auto current_chunk_view =
cached_bits_.view(current_data_chunk_pos_, real_batch_size);
res |= current_chunk_view;
current_data_chunk_pos_ += real_batch_size;
return res_vec;
}