You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Teddy Choi (JIRA)" <ji...@apache.org> on 2015/08/11 16:41:46 UTC

[jira] [Commented] (HIVE-11521) Loop optimization for SIMD in logical operators

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

Teddy Choi commented on HIVE-11521:
-----------------------------------

Sorry. The benchmark result above shows the difference between whether AVX=0 option is applied or not. The result bellow shows the difference between before/after applying this patch. 260% ~ 300% performance improvement in repeating cases.

Before this patch:
{noformat}
Benchmark                                                                       Mode  Samples           Score   Error  Units
o.a.h.b.v.VectorizationBench.ColAndColBench.bench                               avgt        2   169346433.000 ±   NaN  ns/op
o.a.h.b.v.VectorizationBench.ColAndRepeatingColBench.bench                      avgt        2   503688769.000 ±   NaN  ns/op
o.a.h.b.v.VectorizationBench.ColOrColBench.bench                                avgt        2   184679292.500 ±   NaN  ns/op
o.a.h.b.v.VectorizationBench.ColOrRepeatingColBench.bench                       avgt        2   522471397.500 ±   NaN  ns/op
...
o.a.h.b.v.VectorizationBench.NotColBench.bench                                  avgt        2   154808036.000 ±   NaN  ns/op
o.a.h.b.v.VectorizationBench.RepeatingColAndColBench.bench                      avgt        2   478369669.500 ±   NaN  ns/op
o.a.h.b.v.VectorizationBench.RepeatingColOrColBench.bench                       avgt        2   514816574.000 ±   NaN  ns/op
{noformat}

After this patch:
{noformat}
Benchmark                                                                       Mode  Samples           Score   Error  Units
o.a.h.b.v.VectorizationBench.ColAndColBench.bench                               avgt        2   171249531.500 ±   NaN  ns/op
o.a.h.b.v.VectorizationBench.ColAndRepeatingColBench.bench                      avgt        2   130488848.500 ±   NaN  ns/op
o.a.h.b.v.VectorizationBench.ColOrColBench.bench                                avgt        2   168669206.500 ±   NaN  ns/op
o.a.h.b.v.VectorizationBench.ColOrRepeatingColBench.bench                       avgt        2   128768271.500 ±   NaN  ns/op
...
o.a.h.b.v.VectorizationBench.NotColBench.bench                                  avgt        2   149107679.000 ±   NaN  ns/op
o.a.h.b.v.VectorizationBench.RepeatingColAndColBench.bench                      avgt        2   138933203.000 ±   NaN  ns/op
o.a.h.b.v.VectorizationBench.RepeatingColOrColBench.bench                       avgt        2   140216834.500 ±   NaN  ns/op
{noformat}

> Loop optimization for SIMD in logical operators
> -----------------------------------------------
>
>                 Key: HIVE-11521
>                 URL: https://issues.apache.org/jira/browse/HIVE-11521
>             Project: Hive
>          Issue Type: Sub-task
>            Reporter: Teddy Choi
>            Assignee: Teddy Choi
>            Priority: Minor
>         Attachments: HIVE-11521.patch
>
>
> JVM is quite strict on the code schema which may executed with SIMD instructions, take a loop in ColOrCol.java for example,
> {code}
> for (int i = 0; i != n; i++) {
>   outputVector[i] = vector1[0] | vector2[i];
> }
> {code}
> The "vector1\[0\]" reference would prevent JVM to execute this part of code with vectorized instructions, we need to assign the "vector1\[0\]" to a variable outside of loop, and use that variable in loop.
> This issues covers AND, OR, NOT logical operators.



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