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 d8e8bc0e69 [Improvement](predicate) Replace for-loop by memcpy (#12867)
d8e8bc0e69 is described below
commit d8e8bc0e69135c78b164a4ad7b59c68c5f2e2b4b
Author: Gabriel <[email protected]>
AuthorDate: Sun Sep 25 18:27:59 2022 +0800
[Improvement](predicate) Replace for-loop by memcpy (#12867)
---
be/src/vec/columns/predicate_column.h | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/be/src/vec/columns/predicate_column.h
b/be/src/vec/columns/predicate_column.h
index fd99d4c04b..d5ad52b6ac 100644
--- a/be/src/vec/columns/predicate_column.h
+++ b/be/src/vec/columns/predicate_column.h
@@ -133,13 +133,9 @@ private:
}
}
- // note(wb): Write data one by one has a slight performance improvement
than memcpy directly
void insert_many_default_type(const char* data_ptr, size_t num) {
- T* input_val_ptr = (T*)data_ptr;
T* res_val_ptr = (T*)data.get_end_ptr();
- for (int i = 0; i < num; i++) {
- res_val_ptr[i] = input_val_ptr[i];
- }
+ memcpy(res_val_ptr, data_ptr, num * sizeof(T));
res_val_ptr += num;
data.set_end_ptr(res_val_ptr);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]