Skip to content

Commit ab86daf

Browse files
save-bufferwestonpace
authored andcommitted
ARROW-14479: [C++] Hash Join Microbenchmarks
Added microbenchmarks for Hash Join (using OpenMP for parallelism for now). Also added a python script that analyzes the benchmark file and makes a lot of pretty graphs! Closes apache#11876 from save-buffer/sasha_benchmark Authored-by: Sasha Krassovsky <krassovskysasha@gmail.com> Signed-off-by: Weston Pace <weston.pace@gmail.com>
1 parent 2ec4e99 commit ab86daf

6 files changed

Lines changed: 635 additions & 0 deletions

File tree

cpp/CMakePresets.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
"cacheVariables": {
4141
"ARROW_BUILD_BENCHMARKS": "ON",
4242
"ARROW_BUILD_BENCHMARKS_REFERENCE": "ON",
43+
"ARROW_BUILD_OPENMP_BENCHMARKS": "ON",
44+
"ARROW_BUILD_DETAILED_BENCHMARKS": "OFF",
4345
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
4446
}
4547
},

cpp/cmake_modules/BuildUtils.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,10 @@ function(ADD_BENCHMARK REL_BENCHMARK_NAME)
609609
set(ARG_LABELS benchmark)
610610
endif()
611611

612+
if(ARROW_BUILD_DETAILED_BENCHMARKS)
613+
target_compile_definitions(${BENCHMARK_NAME} PRIVATE ARROW_BUILD_DETAILED_BENCHMARKS)
614+
endif()
615+
612616
add_test(${BENCHMARK_NAME}
613617
${BUILD_SUPPORT_DIR}/run-test.sh
614618
${CMAKE_BINARY_DIR}

cpp/cmake_modules/DefineOptions.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,12 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
168168
define_option(ARROW_BUILD_BENCHMARKS_REFERENCE
169169
"Build the Arrow micro reference benchmarks" OFF)
170170

171+
define_option(ARROW_BUILD_OPENMP_BENCHMARKS
172+
"Build the Arrow benchmarks that rely on OpenMP" OFF)
173+
174+
define_option(ARROW_BUILD_DETAILED_BENCHMARKS
175+
"Build benchmarks that do a longer exploration of performance" OFF)
176+
171177
if(ARROW_BUILD_SHARED)
172178
set(ARROW_TEST_LINKAGE_DEFAULT "shared")
173179
else()

cpp/src/arrow/compute/exec/CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,19 @@ add_arrow_compute_test(util_test PREFIX "arrow-compute")
3232

3333
add_arrow_benchmark(expression_benchmark PREFIX "arrow-compute")
3434

35+
if(ARROW_BUILD_OPENMP_BENCHMARKS)
36+
find_package(OpenMP REQUIRED)
37+
add_arrow_benchmark(hash_join_benchmark
38+
PREFIX
39+
"arrow-compute"
40+
EXTRA_LINK_LIBS
41+
OpenMP::OpenMP_CXX)
42+
if(MSVC)
43+
target_compile_options(arrow-compute-hash-join-benchmark
44+
PRIVATE "-openmp:experimental -openmp:llvm")
45+
endif()
46+
endif()
47+
3548
add_arrow_compute_test(ir_test
3649
PREFIX
3750
"arrow-compute"

0 commit comments

Comments
 (0)