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 505F9187FF for ; Thu, 6 Aug 2015 16:52:06 +0000 (UTC) Received: (qmail 71951 invoked by uid 500); 6 Aug 2015 16:52:06 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 71898 invoked by uid 500); 6 Aug 2015 16:52:06 -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 71886 invoked by uid 99); 6 Aug 2015 16:52:06 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Aug 2015 16:52:06 +0000 Date: Thu, 6 Aug 2015 16:52:06 +0000 (UTC) From: "Ted Yu (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-14186) Read mvcc vlong optimization 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-14186?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14660309#comment-14660309 ] Ted Yu commented on HBASE-14186: -------------------------------- +1 on integrating to branch-1 > Read mvcc vlong optimization > ---------------------------- > > Key: HBASE-14186 > URL: https://issues.apache.org/jira/browse/HBASE-14186 > Project: HBase > Issue Type: Sub-task > Components: Performance, Scanners > Reporter: Anoop Sam John > Assignee: Anoop Sam John > Fix For: 2.0.0 > > Attachments: HBASE-14186.patch > > > {code} > for (int idx = 0; idx < remaining; idx++) { > byte b = blockBuffer.getByteAfterPosition(offsetFromPos + idx); > i = i << 8; > i = i | (b & 0xFF); > } > {code} > Doing the read as in case of BIG_ENDIAN. > After HBASE-12600, we tend to keep the mvcc and so byte by byte read looks eating up lot of CPU time. (In my test HFileReaderImpl#_readMvccVersion comes on top in terms of hot methods). We can optimize here by reading 4 or 2 bytes in one shot when the length of the vlong is more than 4 bytes. We will in turn use UnsafeAccess methods which handles ENDIAN. -- This message was sent by Atlassian JIRA (v6.3.4#6332)