[ 
https://issues.apache.org/jira/browse/HIVE-10235?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chengxiang Li updated HIVE-10235:
---------------------------------
    Attachment: HIVE-10235.1.patch

Test with Jmh VectorizationBench by the following command:
{code:actionscript}
java -jar hive-jmh/target/benchmarks.jar 
org.apache.hive.benchmark.vectorization VectorizationBench -wi 3 -i 5 -f 1 -bm 
avgt -tu ms
{code}
The performance result looks like
||Expressions||/w patch(ms)||/w/o patch(ms)||
|DoubleColDivideDoubleColumn|4033|6654|
|DoubleColDivideRepeatingDoubleColumn|1563|3048|
|LongColDivideLongColumn|7354|7561|
|LongColDivideRepeatingColumn|3161|3163|
For for double array division in loop, the packed instruction "vdivpd" is used 
instead of "vdivsd" with patch applied, while there is no such instruction for 
long division, so there is no improvement for long array division in loop.

> Loop optimization for SIMD in ColumnDivideColumn.txt
> ----------------------------------------------------
>
>                 Key: HIVE-10235
>                 URL: https://issues.apache.org/jira/browse/HIVE-10235
>             Project: Hive
>          Issue Type: Sub-task
>          Components: Vectorization
>    Affects Versions: 1.1.0
>            Reporter: Chengxiang Li
>            Assignee: Chengxiang Li
>            Priority: Minor
>         Attachments: HIVE-10235.1.patch
>
>
> Found two loop which could be optimized for packed instruction set during 
> execution.
> 1. hasDivBy0 depends on the result of last loop, which prevent the loop be 
> executed vectorized.
> {code:java}
> for(int i = 0; i != n; i++) {
>       <OperandType2> denom = vector2[i];
>       outputVector[i] = vector1[0] <OperatorSymbol> denom;
>       hasDivBy0 = hasDivBy0 || (denom == 0);
> }
> {code}
> 2. same as HIVE-10180, vector2\[0\] reference provent JVM optimizing loop 
> into packed instruction set.
> {code:java}
> for(int i = 0; i != n; i++) {
>       outputVector[i] = vector1[i] <OperatorSymbol> vector2[0];
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to