[ 
https://issues.apache.org/jira/browse/HBASE-6621?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lars Hofhansl updated HBASE-6621:
---------------------------------

    Attachment: 6621-0.96.txt

Simple patch.
currKeyLen and currValueLen are up to date (and they are in fact used in the 
getKey() and getValue() methods.
This patch uses them in getKeyValue() as well, and hence avoids two Bytes.toInt 
conversion for each read KV during scanning.
                
> Reduce calls to Bytes.toInt
> ---------------------------
>
>                 Key: HBASE-6621
>                 URL: https://issues.apache.org/jira/browse/HBASE-6621
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Lars Hofhansl
>            Assignee: Lars Hofhansl
>             Fix For: 0.96.0, 0.94.2
>
>         Attachments: 6621-0.96.txt
>
>
> Bytes.toInt shows up quite often in a profiler run.
> It turns out that one source is HFileReaderV2$ScannerV2.getKeyValue().
> Notice that we call the KeyValue(byte[], int) constructor, which forces the 
> constructor to determine its size by reading some of the header information 
> and calculate the size. In this case, however, we already know the size (from 
> the call to readKeyValueLen), so we could just use that.
> In the extreme case of 10000's of columns this noticeably reduces CPU. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to