clarax edited a comment on pull request #3575: URL: https://github.com/apache/hbase/pull/3575#issuecomment-896561983
> OK, forgot the expand the diff of the first file... > > Is it just because we need to copy the whole array when adding or removing elements from an array? Is it possible to just make use of something like primitive collections? Use ArrayList and HashMap will cost several times more memories... There is one thing I need to explain. The int[] for all data structures I replaced with either HashSet or HashMap were to store region indexes in sorted order. The look up is always by the value of the array element, not the index, so the access is always in O(n). Because it is sorted, adding a value requires array copy. Removal is the same. I don't like the memory bloating either. Let me explore if I can find sth more memory efficient while serving the needs. -- 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]
