[ https://issues.apache.org/jira/browse/HBASE-22671?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nick Dimiduk updated HBASE-22671: --------------------------------- Affects Version/s: 2.4.0 2.3.0 2.5.0 > 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: Improvement > Affects Versions: 3.0.0-alpha-1, 2.3.0, 2.4.0, 2.5.0 > 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)