You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Nick Dimiduk (Jira)" <ji...@apache.org> on 2021/11/11 16:22:00 UTC
[jira] [Commented] (HBASE-22671) ByteBufferUtils#findCommonPrefix()
can be safely changed to ArraysSupport#mismatch()
[ https://issues.apache.org/jira/browse/HBASE-22671?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17442341#comment-17442341 ]
Nick Dimiduk commented on HBASE-22671:
--------------------------------------
How do you propose we access this class? {{ArraysSupport}} is a JDK-internal class.
> ByteBufferUtils#findCommonPrefix() can be safely changed to ArraysSupport#mismatch()
> ------------------------------------------------------------------------------------
>
> Key: HBASE-22671
> URL: https://issues.apache.org/jira/browse/HBASE-22671
> Project: HBase
> Issue Type: Sub-task
> Affects Versions: 3.0.0-alpha-1
> Reporter: ramkrishna.s.vasudevan
> Assignee: ramkrishna.s.vasudevan
> Priority: Minor
>
> Microbenchmarks reveal that finding the common prefix for encoders can safely be replaced with ArraysSupport#mismatch().
> the microbenchmark just compares Cells that are backed with array and BB.
> For a 27 bit common row prefix the existing BBUtils#findCommonPrefix
> {code}
> Benchmark Mode Cnt Score Error Units
> PrefixComparator.arrayBBCompare avgt 10 869.897 ± 9.429 ns/op
> PrefixComparator.arrayCompare avgt 10 302.074 ± 13.448 ns/op
> PrefixComparator.bbArrayCompare avgt 10 869.369 ± 5.368 ns/op
> PrefixComparator.bbCompare avgt 10 409.479 ± 1.587 ns/op
> {code}
> the same with ArraysSupport#mismatch() change gives this
> {code}
> Benchmark Mode Cnt Score Error Units
> PrefixComparator.arrayBBCompare avgt 10 311.946 ± 1.902 ns/op
> PrefixComparator.arrayCompare avgt 10 157.010 ± 4.482 ns/op
> PrefixComparator.bbArrayCompare avgt 10 311.568 ± 1.348 ns/op
> PrefixComparator.bbCompare avgt 10 92.540 ± 0.501 ns/op
> {code}
> How ever note that this comes in flushes/compaction and not during the read path.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)