hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "stack (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-14186) Read mvcc vlong optimization
Date Tue, 04 Aug 2015 19:22:05 GMT

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

stack commented on HBASE-14186:
-------------------------------

Excellent.

Here, 	        if (remaining >= Bytes.SIZEOF_INT) {.... Is it possible, that we could come
in here and there'd only be a short amount to read so we'd skip the SIZEOF_INT parens?  if
so, the shift by 16 bits in the second paren would be not needed (might not be a problem if
left shifting 0)?

Otherwise, +1. Nice.



> Read mvcc vlong optimization
> ----------------------------
>
>                 Key: HBASE-14186
>                 URL: https://issues.apache.org/jira/browse/HBASE-14186
>             Project: HBase
>          Issue Type: Sub-task
>          Components: 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)

Mime
View raw message