Jim Apple has posted comments on this change.

Change subject: IMPALA-2809: improve ByteSwap with builtin function or SSE or 
AVX2
......................................................................


Patch Set 3:

(8 comments)

http://gerrit.cloudera.org:8080/#/c/3081/3/be/src/benchmarks/bswap-benchmark.cc
File be/src/benchmarks/bswap-benchmark.cc:

Line 35: Impala
These names are pretty confusing. Aren't all of the benchmarked functions 
impala byteswaps?


Line 121:   vector<Decimal4Value> d4_values;
What to decimals have to do with byteswapping?


Line 151: inline void ByteSwapAVX2(void* dest, const void* source, int len) {
It would be good to benchmark the function actually used for byteswapping, not 
these close approximations. That way, if the one used in production changes, 
re-running this benchmark will show the news results.


Line 156:   if (num_bytes == 4) {
This is a lot of code with a lot of near-repetition and no comments. It could 
use refactoring and a high-level explanation of the algorithm. The name is true 
for the other functions below.


http://gerrit.cloudera.org:8080/#/c/3081/3/be/src/util/bit-util.inline.h
File be/src/util/bit-util.inline.h:

Line 140:   const __m128i mask = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 
11, 12, 13, 14,
Can you lift this out of the function into a global that gets initialized on 
impalad start? That might get you a speedup.


Line 164:   const __m256i mask = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 
10, 11, 12, 13, 14,
Same comment here about lifting to a global.


Line 174: inline void ByteSwapAVX2(void* dest, const void* source, int len) {
You can combine this with ByteSwapSSE by making 32 and ByteSwapAVX2_Unit 
template parameters.


Line 193:     } else if( CpuInfo::IsSupported(CpuInfo::SSE4_2) ){
LIKELY(CpuInfo:: ....


-- 
To view, visit http://gerrit.cloudera.org:8080/3081
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I392ed5a8d5683f30f161282c228c1aedd7b648c1
Gerrit-PatchSet: 3
Gerrit-Project: Impala
Gerrit-Branch: cdh5-trunk
Gerrit-Owner: Youwei Wang <[email protected]>
Gerrit-Reviewer: Alex Behm <[email protected]>
Gerrit-Reviewer: Jim Apple <[email protected]>
Gerrit-Reviewer: Marcel Kornacker <[email protected]>
Gerrit-Reviewer: Mostafa Mokhtar <[email protected]>
Gerrit-Reviewer: Tim Armstrong <[email protected]>
Gerrit-Reviewer: Youwei Wang <[email protected]>
Gerrit-HasComments: Yes

Reply via email to