You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/04/26 09:22:44 UTC

[GitHub] [incubator-doris] yiguolei commented on a diff in pull request #9226: [Enhancement]Avoid unnecessary calculations in HashTableGrower

yiguolei commented on code in PR #9226:
URL: https://github.com/apache/incubator-doris/pull/9226#discussion_r858489546


##########
be/src/vec/common/hash_table/hash_table.h:
##########
@@ -245,11 +245,14 @@ struct HashTableGrower {
     /// The state of this structure is enough to get the buffer size of the hash table.
     doris::vectorized::UInt8 size_degree = initial_size_degree;
 
+    size_t _buf_size = 1ULL << initial_size_degree;
+    size_t _max_fill = 1ULL << (initial_size_degree - 1);
+
     /// The size of the hash table in the cells.
-    size_t buf_size() const { return 1ULL << size_degree; }
+    size_t buf_size() const { return _buf_size; }

Review Comment:
   if the size_degree is modified in increase_size method. The buffer size should changed but in your code, the buffer size is const.



-- 
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-unsubscribe@doris.apache.org

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


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