Skip to content

Commit

Permalink
[opt](func) opt the revert_null_map performance (apache#34393)
Browse files Browse the repository at this point in the history
  • Loading branch information
HappenLee authored May 5, 2024
1 parent d487355 commit ac23933
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions be/src/vec/data_types/serde/data_type_serde.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,11 @@ inline static NullMap revert_null_map(const NullMap* null_bytemap, size_t start,
return res;
}

res.reserve(end - start);
for (size_t i = start; i < end; ++i) {
res.emplace_back(!(*null_bytemap)[i]);
res.resize(end - start);
auto* __restrict src_data = (*null_bytemap).data();
auto* __restrict res_data = res.data();
for (size_t i = 0; i < res.size(); ++i) {
res_data[i] = !src_data[i + start];
}
return res;
}
Expand Down

0 comments on commit ac23933

Please sign in to comment.