You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Todd Lipcon (JIRA)" <ji...@apache.org> on 2011/06/13 06:35:51 UTC
[jira] [Commented] (HBASE-3928) Some potential performance
improvements to Bytes/KeyValue
[ https://issues.apache.org/jira/browse/HBASE-3928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13048464#comment-13048464 ]
Todd Lipcon commented on HBASE-3928:
------------------------------------
I ran some single-node benchmarks on my laptop. It doesn't seem to make a significant difference either way. Since logic says it should help, may as well commit it - certainly doesn't make things worse.
> Some potential performance improvements to Bytes/KeyValue
> ---------------------------------------------------------
>
> Key: HBASE-3928
> URL: https://issues.apache.org/jira/browse/HBASE-3928
> Project: HBase
> Issue Type: Improvement
> Affects Versions: 0.92.0
> Reporter: Todd Lipcon
> Assignee: Todd Lipcon
> Priority: Critical
> Attachments: hbase-3928.txt
>
>
> We use Bytes.compareTo() a lot where we could be using a more efficient equals() method. The trick that makes equals() faster than compareTo is that we can short-circuit two common cases:
> Case 1) the length is not the same - only need to do one comparison
> Case 2) the two arrays have the same length and a common prefix: compare the last byte first, since it's the one most likely to differ (given we are usually comparing adjacent sorted data).
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira