kangpinghuang commented on a change in pull request #243: Skip unnecessary 
stream init and decrease the TCMalloc pressure (#242)
URL: https://github.com/apache/incubator-doris/pull/243#discussion_r225074663
 
 

 ##########
 File path: be/src/olap/column_file/segment_reader.cpp
 ##########
 @@ -775,6 +775,14 @@ OLAPStatus SegmentReader::_read_all_data_streams(size_t* 
buffer_size) {
             continue;
         }
 
+        //skip unnecessary stream init
+        //if the query doesn't inclde this column, we needn't init the stream 
for this column
+        //to reduce the call times for ByteBuffer::create and decrease the 
TCMalloc pressure
+        if (!_is_column_included(unique_column_id)) {
+            *buffer_size += OLAP_DEFAULT_COLUMN_STREAM_BUFFER_SIZE + 
sizeof(StreamHead);
+            continue;
+        }
+
 
 Review comment:
   it is done in line 768~771 and there is no need to add buffer_size if the 
column is not included

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to