This is an automated email from the ASF dual-hosted git repository. yiguolei pushed a commit to branch opt_perf in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/opt_perf by this push: new 2b27aaa2fa [Improvement](predicate) Replace for-loop by memcpy (#12879) 2b27aaa2fa is described below commit 2b27aaa2fa888ca2fe4634553034ea2f33e37ab4 Author: Gabriel <gabrielleeb...@gmail.com> AuthorDate: Thu Sep 22 19:46:52 2022 +0800 [Improvement](predicate) Replace for-loop by memcpy (#12879) --- 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: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org