Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CE0DD185F2 for ; Mon, 4 Jan 2016 10:23:40 +0000 (UTC) Received: (qmail 42102 invoked by uid 500); 4 Jan 2016 10:23:40 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 42012 invoked by uid 500); 4 Jan 2016 10:23:40 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 41743 invoked by uid 99); 4 Jan 2016 10:23:40 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Jan 2016 10:23:40 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id DC87D2C1F62 for ; Mon, 4 Jan 2016 10:23:39 +0000 (UTC) Date: Mon, 4 Jan 2016 10:23:39 +0000 (UTC) From: "Anoop Sam John (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-14524) Short-circuit comparison of rows in CellComparator MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-14524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15080943#comment-15080943 ] Anoop Sam John commented on HBASE-14524: ---------------------------------------- Checked this. Yes at begin of row we do this. In StoreScanner#next(List outResult, ScannerContext scannerContext), we set the cur cell as the new row to SQM. And after this there is a loop to fetch cells for the row and in that every cell is being matched by SQM. In that flow, for the 1st cell, it will get compared against itself. In Bytes.java there is a short circuit for this. BBUtils compare method missed that. By adding this object == check, we can avoid unwanted bytes compare (all bytes of rows) and type checks. +1. We can get this in. > Short-circuit comparison of rows in CellComparator > -------------------------------------------------- > > Key: HBASE-14524 > URL: https://issues.apache.org/jira/browse/HBASE-14524 > Project: HBase > Issue Type: Improvement > Reporter: Lars Francke > Assignee: Lars Francke > Priority: Minor > Attachments: HBASE-14524.patch, HBASE-14524.patch > > > {{CellComparator#compareRows}} compares two rows. For Scans and Gets these objects can sometimes be exactly the same object. > I see this (without fully understanding everything that's going on) for the first cell in each row. > In these circumstances I think it makes sense to short-circuit the comparison (not do a byte comparison and class cast checks) and bail out early if the objects are identical. -- This message was sent by Atlassian JIRA (v6.3.4#6332)