You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2021/08/11 06:47:40 UTC

[GitHub] [hbase] clarax commented on pull request #3575: HBASE-26178 Improve data structure and algorithm for BalanceClusterSt…

clarax commented on pull request #3575:
URL: https://github.com/apache/hbase/pull/3575#issuecomment-896547064


   > In general, except in PrimaryRegionCountSkewCostFunction.regionMoved, I haven't seen any advantages of the changes here.
   > 
   > ArrayList is slower than a plain int[], as int[] is more cache friendly.
   > 
   > And for changing array to HashMap, I do not see any advantages either. Locating an element in array is also O(1), it will be faster than locating a value in HashMap...
   > 
   > So could you please write a simple design doc to describe what you are trying to do here?
   
   @Apache9 Yes, it is a valid concern that ArrayList could be slower than int[]. But it is not a good idea to mix generic and primitives. The goal here is we can save time when we have large collections. Let me comment the pull request code comparison to explain the change of time complexity of the algorithms.


-- 
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: issues-unsubscribe@hbase.apache.org

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