zuochunwei commented on a change in pull request #7855:
URL: https://github.com/apache/incubator-doris/pull/7855#discussion_r790575780
##########
File path: be/src/vec/columns/column_vector.h
##########
@@ -120,10 +120,13 @@ class ColumnVector final : public
COWHelper<ColumnVectorHelper, ColumnVector<T>>
ColumnVector(std::initializer_list<T> il) : data {il} {}
void insert_res_column(const uint16_t* sel, size_t sel_size,
vectorized::ColumnVector<T>* res_ptr) {
+ auto& res_data = res_ptr->data;
+ res_data.reserve(res_ptr->size() + sel_size);
Review comment:
because i will insert sel_size elements into res_ptr's data
the operation of reserve will supply enough memory for assigning one by one
in the loop.
each insert_data() call will check whether need to alloc bigger memory chunk
in push_back(), that's not highly efficient.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]