[ 
https://issues.apache.org/jira/browse/HBASE-14550?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14961756#comment-14961756
 ] 

Anoop Sam John commented on HBASE-14550:
----------------------------------------

It is a nice to have.. In Bytes.java  we can see short circuit checks in 
compare/equals methods
{code}
public static boolean equals(final byte[] left, int leftOffset, int leftLen,
                               final byte[] right, int rightOffset, int 
rightLen) {
    // short circuit case
    if (left == right &&
        leftOffset == rightOffset &&
        leftLen == rightLen) {
      return true;
    }
{code}

I saw another issue being raised (forgot id) which says to add short circuit 
check for same cells in CellComparator compare methods..  It says we call the 
method with same objects some times..  Am not sure how/why..  Asked a Q 
there...   If such things happen in some way, the Bytes check would have helped 
us..  But in BBUtils  it will just do all bytes checks!!

So what do you think?  IMO we should check why we call compare with same 
Cells.. May be that is some thing we can not avoid?  If so add the short 
circuit is a must..  Again that will be best to add in CellComparator.    But 
for equals method also it might be necessary..  So CellUtil equals?

Just raised it as a tracker..   We can do the above  in that old jira..  

> Short circuit checks in ByteBufferUtils compare/equals
> ------------------------------------------------------
>
>                 Key: HBASE-14550
>                 URL: https://issues.apache.org/jira/browse/HBASE-14550
>             Project: HBase
>          Issue Type: Sub-task
>          Components: regionserver, Scanners
>            Reporter: Anoop Sam John
>            Assignee: Anoop Sam John
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to