This is an automated email from the ASF dual-hosted git repository.
lihaopeng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new ac23933a5db [opt](func) opt the revert_null_map performance (#34393)
ac23933a5db is described below
commit ac23933a5db437ed7d2e17e5866acd12c534f6fd
Author: HappenLee <[email protected]>
AuthorDate: Sun May 5 19:30:49 2024 +0800
[opt](func) opt the revert_null_map performance (#34393)
---
be/src/vec/data_types/serde/data_type_serde.h | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/be/src/vec/data_types/serde/data_type_serde.h
b/be/src/vec/data_types/serde/data_type_serde.h
index 464e23a9319..81feaf60d2e 100644
--- a/be/src/vec/data_types/serde/data_type_serde.h
+++ b/be/src/vec/data_types/serde/data_type_serde.h
@@ -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;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]