[
https://issues.apache.org/jira/browse/HBASE-27146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17558085#comment-17558085
]
Duo Zhang commented on HBASE-27146:
-----------------------------------
Implement a JMH microbenchmark
https://github.com/Apache9/hbase-jmh-test/blob/master/src/main/java/org/apache/hadoop/hbase/MetaCellComparatorBenchmark.java
For MetaCellComparator on 2.4.12, the result is
{noformat}
Benchmark Mode Samples Score Score
error Units
o.a.h.h.MetaCellComparatorBenchmark.compare avgt 10 63514.862
928.458 ns/op
{noformat}
For MetaCellComparator in the PR, the result is
{noformat}
Benchmark Mode Samples Score Score
error Units
o.a.h.h.MetaCellComparatorBenchmark.compare avgt 10 34262.569
412.400 ns/op
{noformat}
The modified version's latency is about 54% of the unmodified version, i.e,
about 85% faster, when comparing ByteBufferKeyValue where the ByteBuffer is in
off heap memory.
> Avoid CellUtil.cloneRow in MetaCellComparator
> ---------------------------------------------
>
> Key: HBASE-27146
> URL: https://issues.apache.org/jira/browse/HBASE-27146
> Project: HBase
> Issue Type: Improvement
> Reporter: Duo Zhang
> Assignee: Duo Zhang
> Priority: Major
>
> In HBASE-26981, a flame graph shows that we spend a lot of CPUs in
> CellUtils.cloneXXX.
> Since we need to split the row to different parts when comparing, we can not
> use ByteBuffer compare directly, but as least, we should try to avoid copy
> the content when the Cell is stored in a ByteBuffer.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)