hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Heng Chen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-16278) Use ConcurrentHashMap instead of ConcurrentSkipListMap if possible
Date Mon, 25 Jul 2016 08:18:20 GMT

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

Heng Chen commented on HBASE-16278:

I don't  think use {{ByteArrayWrapper}} as [~Apache9] said above has essential difference
with {{ConcurrentHashByteArrayMap}} which [~ikeda] uploaded.  
It seems {{ConcurrentHashByteArrayMap}} has wrapped the byte[] internal, but [~Apache9] do
it explicitly outside the CHM....   

> Use ConcurrentHashMap instead of ConcurrentSkipListMap if possible
> ------------------------------------------------------------------
>                 Key: HBASE-16278
>                 URL: https://issues.apache.org/jira/browse/HBASE-16278
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Duo Zhang
>         Attachments: ConcurrentHashByteArrayMap.java
> SSD and 10G network make our system CPU bound again, so the speed of memory operation
only code becomes more and more important.
> In HBase, if want to use byte[] as a map key, then we will always use CSLM even if we
do not need the map to be ordered. I know that this could save one object allocation since
we can not use byte[] directly as CHM's key. But we all know that CHM is faster than CSLM,
so I wonder if it worth to use CSLM instead of CHM only because one extra object allocation.
> Then I wrote a simple jmh micro benchmark to test the performance of CHM and CSLM. The
code could be found here
> https://github.com/Apache9/microbench
> It turns out that CHM is still much faster than CSLM with one extra object allocation.
> So I think we should always use CHM if we do not need the keys to be sorted.

This message was sent by Atlassian JIRA

View raw message