JinHyuk Kim created HBASE-29995:
-----------------------------------

             Summary: Improve existing hash implementations by reading 4 bytes 
at once
                 Key: HBASE-29995
                 URL: https://issues.apache.org/jira/browse/HBASE-29995
             Project: HBase
          Issue Type: Improvement
          Components: regionserver
            Reporter: JinHyuk Kim
            Assignee: JinHyuk Kim
         Attachments: jenkins_intLE.png, murmur2_intLE.png, murmur3_intLE.png

h1. Description

Currently, the hash implementations read input data *one byte at a time* when 
constructing 32-bit values.

This change proposes a small optimization by reading *4 bytes at once* using 
{{Unsafe}} when available, with a fallback to the existing pure Java 
implementation.

The resulting hash values remain {*}exactly the same{*}, and this change only 
reduces instruction count in the inner loop.

Expected outcome is a small performance improvement without any behavioral 
change.
h1. Improvements
||Length||Jenkins||*Jenkins After*||Δ%||Murmur||*Murmur 
After*||Δ%||Murmur3||*Murmur3 After*||Δ%||
|3|377M|*381M*|+1.2%|598M|*599M*|+0.3%|622M|*619M*|-0.5%|
|8|323M|*330M*|+2.2%|315M|*417M*|+32.5%|275M|*384M*|+39.6%|
|16|147M|*204M*|+39.0%|246M|*339M*|+37.7%|207M|*282M*|+35.8%|
|32|100M|*139M*|+38.5%|145M|*208M*|+43.3%|128M|*176M*|+37.2%|
|64|51M|*70M*|+38.2%|85M|*113M*|+32.4%|70M|*89M*|+28.0%|
|128|26M|*33M*|+27.7%|44M|*56M*|+28.4%|36M|*42M*|+15.9%|
|240|13M|*17M*|+33.6%|23M|*29M*|+23.8%|18M|*19M*|+8.0%|
|256|12M|*16M*|+31.4%|22M|*27M*|+22.0%|15M|*18M*|+23.6%|
|512|6M|*8M*|+26.5%|10M|*12M*|+14.9%|7M|*7M*|+2.0%|
|1024|3M|*4M*|+26.8%|5M|*5M*|+10.5%|3M|*4M*|+6.0%|
|2048|1M|*2M*|+27.3%|2M|*2M*|+6.3%|2M|*2M*|+5.5%|
|4096|709K|*934K*|+31.8%|1M|*1M*|+10.1%|802K|*833K*|+3.8%|
|16384|185K|*232K*|+25.6%|254K|*262K*|+3.0%|199K|*197K*|-0.8%|



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to