[
https://issues.apache.org/jira/browse/HIVE-11533?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Teddy Choi updated HIVE-11533:
------------------------------
Attachment: HIVE-11533.4.patch
Fixed remaining bugs and added more comments and unit tests.
Integer comparisons are very common in Hive operations. Tinyint, smallint, int,
bigint, timestamp, date, and interval data types are implemented by using
LongColumnVector. Therefore they share comparison logics. This optimization
makes them run at 2.5x throughput with AVX2 or even 1.5x throughput even
without AVX2.
With AVX2 CPU support, this patch provides 245% (min 150%, max 394%)
performance on average integer comparisons. Without AVX2 CPU support, it
provides 152% (min 89%, max 239%) performance on average integer comparisons.
|| Class || Rel perf with AVX2 || Rel perf w/o AVX2
||
| LongColEqualLongColumn | 150% | 89% |
| LongColEqualLongScalar | 175% | 107% |
| LongColGreaterEqualLongColumn | 234% | 145% |
| LongColGreaterEqualLongScalar | 295% | 201% |
| LongColGreaterLongColumn | 228% | 160% |
| LongColGreaterLongScalar | 333% | 198% |
| LongColLessEqualLongColumn | 229% | 129% |
| LongColLessEqualLongScalar | 230% | 169% |
| LongColLessLongColumn | 161% | 150% |
| LongColLessLongScalar | 289% | 226% |
| LongColNotEqualLongColumn | 176% | 93% |
| LongColNotEqualLongScalar | 179% | 91% |
| LongScalarEqualLongColumn | 182% | 96% |
| LongScalarGreaterEqualLongColumn | 322% | 168%
|
| LongScalarGreaterLongColumn | 394% | 239% |
| LongScalarLessEqualLongColumn | 302% | 189% |
| LongScalarLessLongColumn | 342% | 190% |
| LongScalarNotEqualLongColumn | 182% | 87% |
|| Average || 245% || 152% ||
> Loop optimization for SIMD in Long*CompareLong*
> -----------------------------------------------
>
> Key: HIVE-11533
> URL: https://issues.apache.org/jira/browse/HIVE-11533
> Project: Hive
> Issue Type: Sub-task
> Components: Vectorization
> Reporter: Teddy Choi
> Assignee: Teddy Choi
> Priority: Minor
> Attachments: HIVE-11533.1.patch, HIVE-11533.2.patch,
> HIVE-11533.3.patch, HIVE-11533.4.patch
>
>
> Long*CompareLong* classes can be optimized with subtraction and bitwise
> operators for better SIMD optimization.
> {code}
> for(int i = 0; i != n; i++) {
> outputVector[i] = vector1[0] > vector2[i] ? 1 : 0;
> }
> {code}
> This issue will cover following classes;
> - LongColEqualLongColumn
> - LongColNotEqualLongColumn
> - LongColGreaterLongColumn
> - LongColGreaterEqualLongColumn
> - LongColLessLongColumn
> - LongColLessEqualLongColumn
> - LongScalarEqualLongColumn
> - LongScalarNotEqualLongColumn
> - LongScalarGreaterLongColumn
> - LongScalarGreaterEqualLongColumn
> - LongScalarLessLongColumn
> - LongScalarLessEqualLongColumn
> - LongColEqualLongScalar
> - LongColNotEqualLongScalar
> - LongColGreaterLongScalar
> - LongColGreaterEqualLongScalar
> - LongColLessLongScalar
> - LongColLessEqualLongScalar
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)