zuochunwei commented on a change in pull request #8292:
URL: https://github.com/apache/incubator-doris/pull/8292#discussion_r817593579



##########
File path: be/src/vec/columns/column_string.h
##########
@@ -165,10 +167,33 @@ class ColumnString final : public COWHelper<IColumn, 
ColumnString> {
         }
     };
  
-    void insert_many_dict_data(const int32_t* data_array, size_t start_index, 
const StringRef* dict, size_t num) override {
-        for (size_t end_index = start_index+num; start_index < end_index; 
++start_index) {
-            int32_t codeword = data_array[start_index];
-            insert_data(dict[codeword].data, dict[codeword].size);
+    void insert_many_dict_data(const int32_t* __restrict data_array, size_t 
start_index, const StringRef* __restrict dict, size_t num) override {
+        size_t index = start_index;
+        const size_t end = start_index + num;
+
+        // handle offsets
+        size_t old_size = offsets.size();
+        offsets.resize(old_size + num);
+
+        size_t chars_old_size = chars.size();
+        size_t chars_new_size = chars_old_size;
+        for (; index < end; ++index) {
+            int32_t codeword = data_array[index];
+            chars_new_size += (dict[codeword].size + 1); // extra 1 for zero 
ending
+            offsets[old_size++] = chars_new_size;
+        }
+
+        // handle chars
+        chars.resize(chars_new_size);
+        unsigned char* c_data = chars.data();
+
+        index = start_index;

Review comment:
       > Please add `BlockLoadTime` Timer for performance improvement. I don't 
know what does `11970424864 vs 8907241614` means.
   
   我用一个atomic_uint64的全局变量,累加了这个函数的开销




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to