zanmato1984 commented on code in PR #43832:
URL: https://github.com/apache/arrow/pull/43832#discussion_r1743871601


##########
cpp/src/arrow/acero/hash_join_benchmark.cc:
##########
@@ -640,5 +660,112 @@ BENCHMARK(BM_HashJoinBasic_ProbeParallelism)
 
 #endif  // ARROW_BUILD_DETAILED_BENCHMARKS
 
+void RowArrayDecodeBenchmark(benchmark::State& st, const 
std::shared_ptr<Schema>& schema,
+                             int column_to_decode) {
+  auto batches = MakeRandomBatches(schema, 1, 
std::numeric_limits<uint16_t>::max());
+  const auto& batch = batches.batches[0];
+  RowArray rows;
+  std::vector<uint16_t> row_ids_encode(batch.length);
+  std::iota(row_ids_encode.begin(), row_ids_encode.end(), 0);
+  std::vector<KeyColumnArray> temp_column_arrays;
+  DCHECK_OK(rows.AppendBatchSelection(
+      default_memory_pool(), 
internal::CpuInfo::GetInstance()->hardware_flags(), batch, 0,
+      static_cast<int>(batch.length), static_cast<int>(batch.length),
+      row_ids_encode.data(), temp_column_arrays));
+  std::vector<uint32_t> row_ids_decode(batch.length);
+  // Create a random access pattern to simulate hash join.
+  std::default_random_engine gen(42);
+  std::uniform_int_distribution<uint32_t> dist(0,
+                                               
static_cast<uint32_t>(batch.length - 1));
+  std::transform(row_ids_decode.begin(), row_ids_decode.end(), 
row_ids_decode.begin(),
+                 [&](uint32_t) { return dist(gen); });
+
+  uint64_t total_rows = 0;
+  for (auto _ : st) {
+    st.PauseTiming();

Review Comment:
   I guess not, the code in-between is trivial. I'll remove them.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to