[ 
https://issues.apache.org/jira/browse/HIVE-11529?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15853832#comment-15853832
 ] 

Teddy Choi commented on HIVE-11529:
-----------------------------------

It brought up to 4x performance.

Before:
{noformat}
o.a.h.b.v.VectorizedLogicBench.IfExprLongColumnLongColumnBench.bench            
          avgt        2  2201086483.000 ±   NaN  ns/op
o.a.h.b.v.VectorizedLogicBench.IfExprLongColumnLongScalarBench.bench            
          avgt        2  1361940192.000 ±   NaN  ns/op
o.a.h.b.v.VectorizedLogicBench.IfExprLongColumnRepeatingLongColumnBench.bench   
          avgt        2  2965654720.500 ±   NaN  ns/op
o.a.h.b.v.VectorizedLogicBench.IfExprLongScalarLongColumnBench.bench            
          avgt        2  1252793715.000 ±   NaN  ns/op
o.a.h.b.v.VectorizedLogicBench.IfExprLongScalarLongScalarBench.bench            
          avgt        2   525885607.500 ±   NaN  ns/op
o.a.h.b.v.VectorizedLogicBench.IfExprLongScalarRepeatingLongColumnBench.bench   
          avgt        2   937117696.500 ±   NaN  ns/op
o.a.h.b.v.VectorizedLogicBench.IfExprRepeatingLongColumnLongColumnBench.bench   
          avgt        2  2970268531.500 ±   NaN  ns/op
o.a.h.b.v.VectorizedLogicBench.IfExprRepeatingLongColumnLongScalarBench.bench   
          avgt        2  1258292159.500 ±   NaN  ns/op
o.a.h.b.v.VectorizedLogicBench.IfExprRepeatingLongColumnRepeatingLongColumnBench.bench
    avgt        2  2028832459.000 ±   NaN  ns/op
{noformat}

After:
{noformat}
o.a.h.b.v.VectorizedLogicBench.IfExprLongColumnLongColumnBench.bench            
          avgt        2  1905568359.500 ±   NaN  ns/op
o.a.h.b.v.VectorizedLogicBench.IfExprLongColumnLongScalarBench.bench            
          avgt        2   311806588.500 ±   NaN  ns/op V
o.a.h.b.v.VectorizedLogicBench.IfExprLongColumnRepeatingLongColumnBench.bench   
          avgt        2  2950095981.000 ±   NaN  ns/op
o.a.h.b.v.VectorizedLogicBench.IfExprLongScalarLongColumnBench.bench            
          avgt        2   309752757.500 ±   NaN  ns/op V
o.a.h.b.v.VectorizedLogicBench.IfExprLongScalarLongScalarBench.bench            
          avgt        2   227286994.000 ±   NaN  ns/op V
o.a.h.b.v.VectorizedLogicBench.IfExprLongScalarRepeatingLongColumnBench.bench   
          avgt        2   380720489.500 ±   NaN  ns/op V
o.a.h.b.v.VectorizedLogicBench.IfExprRepeatingLongColumnLongColumnBench.bench   
          avgt        2  2974550657.500 ±   NaN  ns/op
o.a.h.b.v.VectorizedLogicBench.IfExprRepeatingLongColumnLongScalarBench.bench   
          avgt        2   385519086.000 ±   NaN  ns/op V
o.a.h.b.v.VectorizedLogicBench.IfExprRepeatingLongColumnRepeatingLongColumnBench.bench
    avgt        2  2079411174.500 ±   NaN  ns/op
{noformat}

> Loop optimization for SIMD in IfExprLong*Long*
> ----------------------------------------------
>
>                 Key: HIVE-11529
>                 URL: https://issues.apache.org/jira/browse/HIVE-11529
>             Project: Hive
>          Issue Type: Sub-task
>          Components: Vectorization
>            Reporter: Teddy Choi
>            Assignee: Teddy Choi
>            Priority: Minor
>         Attachments: HIVE-11529.2.patch, HIVE-11529.3.patch, 
> HIVE-11529.4.patch, HIVE-11529.patch
>
>
> HIVE-10238 showed that ?: operator can be optimized with bitwise operators 
> when it only handles LongColumnVectors. There are more similar cases as 
> following.
> IfExprLongColumnLongScalar: {code}outputVector[i] = (vector1[i] == 1 ? 
> vector2[i] : arg3Scalar);{code}
> IfExprLongScalarLongColumn: {code}outputVector[i] = (vector1[i] == 1 ? 
> arg2Scalar : vector3[i]);{code}
> IfExprLongScalarLongScalar: {code}outputVector[i] = (vector1[i] == 1 ? 
> arg2Scalar : arg3Scalar);{code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to