Skip to content

Commit

Permalink
Remove hacking code
Browse files Browse the repository at this point in the history
  • Loading branch information
zanmato1984 committed Sep 4, 2024
1 parent 4746bd2 commit 5b9f277
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions cpp/src/arrow/acero/swiss_join_avx2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -397,20 +397,6 @@ int RowArray::DecodeFixedLength_avx2(ResizableArrayData* output, int output_star
int column_id, uint32_t fixed_length,
int num_rows_to_append,
const uint32_t* row_ids) const {
// Benchmarking shows that when the data element width is <= 8, the scalar code almost
// always outperforms the vectorized code - about 2X~3X faster when the whole data set
// falls into L1~LLC, and the ratio goes down to about 1:1 as the data size increases
// when most of the accesses hit the main memory. This is possibly because that decoding
// is mostly copying scattered pieces of data and there is not enough computation to pay
// off the cost of the heavy gather instructions.
// For fixed length 0 (boolean column), the vectorized code wins by batching 8 bits into
// a single byte instead of modifying the same byte 8 times in the scalar code.
if (!(fixed_length == 0 || fixed_length > 8)) {
DecodeFixedLength(output, output_start_row, column_id, fixed_length,
num_rows_to_append, row_ids);
return num_rows_to_append;
}

DCHECK_EQ(output_start_row % 8, 0);

int num_rows_processed = 0;
Expand Down Expand Up @@ -483,10 +469,6 @@ int RowArray::DecodeFixedLength_avx2(ResizableArrayData* output, int output_star
int RowArray::DecodeOffsets_avx2(ResizableArrayData* output, int output_start_row,
int column_id, int num_rows_to_append,
const uint32_t* row_ids) const {
// Same reason as DecodeFixedLength_avx2.
DecodeOffsets(output, output_start_row, column_id, num_rows_to_append, row_ids);
return num_rows_to_append;

uint32_t* offsets =
reinterpret_cast<uint32_t*>(output->mutable_data(1)) + output_start_row;
uint32_t current_length = (output_start_row == 0) ? 0 : offsets[0];
Expand Down

0 comments on commit 5b9f277

Please sign in to comment.