diff --git a/cpp/benchmarks/CMakeLists.txt b/cpp/benchmarks/CMakeLists.txt index 10f645dfec0..49504e53424 100644 --- a/cpp/benchmarks/CMakeLists.txt +++ b/cpp/benchmarks/CMakeLists.txt @@ -163,8 +163,10 @@ ConfigureNVBench( # ################################################################################################## # * join benchmark -------------------------------------------------------------------------------- -ConfigureBench(JOIN_BENCH join/left_join.cu join/conditional_join.cu) -ConfigureNVBench(JOIN_NVBENCH join/join.cu join/mixed_join.cu join/distinct_join.cu) +ConfigureNVBench( + JOIN_NVBENCH join/left_join.cu join/conditional_join.cu join/join.cu join/mixed_join.cu + join/distinct_join.cu +) # ################################################################################################## # * iterator benchmark ---------------------------------------------------------------------------- diff --git a/cpp/benchmarks/join/conditional_join.cu b/cpp/benchmarks/join/conditional_join.cu index d95fc0a5b59..e332d09d31b 100644 --- a/cpp/benchmarks/join/conditional_join.cu +++ b/cpp/benchmarks/join/conditional_join.cu @@ -14,250 +14,44 @@ * limitations under the License. */ -#include - -template -class ConditionalJoin : public cudf::benchmark {}; - -// For compatibility with the shared logic for equality (hash) joins, all of -// the join lambdas defined by these macros accept a null_equality parameter -// but ignore it (don't forward it to the underlying join implementation) -// because conditional joins do not use this parameter. -#define CONDITIONAL_INNER_JOIN_BENCHMARK_DEFINE(name, Key, Nullable) \ - BENCHMARK_TEMPLATE_DEFINE_F(ConditionalJoin, name, Key) \ - (::benchmark::State & st) \ - { \ - auto join = [](cudf::table_view const& left, \ - cudf::table_view const& right, \ - cudf::ast::operation binary_pred, \ - cudf::null_equality compare_nulls) { \ - return cudf::conditional_inner_join(left, right, binary_pred); \ - }; \ - BM_join(st, join); \ - } - -CONDITIONAL_INNER_JOIN_BENCHMARK_DEFINE(conditional_inner_join_32bit, int32_t, false); -CONDITIONAL_INNER_JOIN_BENCHMARK_DEFINE(conditional_inner_join_64bit, int64_t, false); -CONDITIONAL_INNER_JOIN_BENCHMARK_DEFINE(conditional_inner_join_32bit_nulls, int32_t, true); -CONDITIONAL_INNER_JOIN_BENCHMARK_DEFINE(conditional_inner_join_64bit_nulls, int64_t, true); - -#define CONDITIONAL_LEFT_JOIN_BENCHMARK_DEFINE(name, Key, Nullable) \ - BENCHMARK_TEMPLATE_DEFINE_F(ConditionalJoin, name, Key) \ - (::benchmark::State & st) \ - { \ - auto join = [](cudf::table_view const& left, \ - cudf::table_view const& right, \ - cudf::ast::operation binary_pred, \ - cudf::null_equality compare_nulls) { \ - return cudf::conditional_left_join(left, right, binary_pred); \ - }; \ - BM_join(st, join); \ - } - -CONDITIONAL_LEFT_JOIN_BENCHMARK_DEFINE(conditional_left_join_32bit, int32_t, false); -CONDITIONAL_LEFT_JOIN_BENCHMARK_DEFINE(conditional_left_join_64bit, int64_t, false); -CONDITIONAL_LEFT_JOIN_BENCHMARK_DEFINE(conditional_left_join_32bit_nulls, int32_t, true); -CONDITIONAL_LEFT_JOIN_BENCHMARK_DEFINE(conditional_left_join_64bit_nulls, int64_t, true); - -#define CONDITIONAL_FULL_JOIN_BENCHMARK_DEFINE(name, Key, Nullable) \ - BENCHMARK_TEMPLATE_DEFINE_F(ConditionalJoin, name, Key) \ - (::benchmark::State & st) \ - { \ - auto join = [](cudf::table_view const& left, \ - cudf::table_view const& right, \ - cudf::ast::operation binary_pred, \ - cudf::null_equality compare_nulls) { \ - return cudf::conditional_full_join(left, right, binary_pred); \ - }; \ - BM_join(st, join); \ - } - -CONDITIONAL_FULL_JOIN_BENCHMARK_DEFINE(conditional_full_join_32bit, int32_t, false); -CONDITIONAL_FULL_JOIN_BENCHMARK_DEFINE(conditional_full_join_64bit, int64_t, false); -CONDITIONAL_FULL_JOIN_BENCHMARK_DEFINE(conditional_full_join_32bit_nulls, int32_t, true); -CONDITIONAL_FULL_JOIN_BENCHMARK_DEFINE(conditional_full_join_64bit_nulls, int64_t, true); - -#define CONDITIONAL_LEFT_ANTI_JOIN_BENCHMARK_DEFINE(name, Key, Nullable) \ - BENCHMARK_TEMPLATE_DEFINE_F(ConditionalJoin, name, Key) \ - (::benchmark::State & st) \ - { \ - auto join = [](cudf::table_view const& left, \ - cudf::table_view const& right, \ - cudf::ast::operation binary_pred, \ - cudf::null_equality compare_nulls) { \ - return cudf::conditional_left_anti_join(left, right, binary_pred); \ - }; \ - BM_join(st, join); \ - } - -CONDITIONAL_LEFT_ANTI_JOIN_BENCHMARK_DEFINE(conditional_left_anti_join_32bit, int32_t, false); -CONDITIONAL_LEFT_ANTI_JOIN_BENCHMARK_DEFINE(conditional_left_anti_join_64bit, int64_t, false); -CONDITIONAL_LEFT_ANTI_JOIN_BENCHMARK_DEFINE(conditional_left_anti_join_32bit_nulls, int32_t, true); -CONDITIONAL_LEFT_ANTI_JOIN_BENCHMARK_DEFINE(conditional_left_anti_join_64bit_nulls, int64_t, true); - -#define CONDITIONAL_LEFT_SEMI_JOIN_BENCHMARK_DEFINE(name, Key, Nullable) \ - BENCHMARK_TEMPLATE_DEFINE_F(ConditionalJoin, name, Key) \ - (::benchmark::State & st) \ - { \ - auto join = [](cudf::table_view const& left, \ - cudf::table_view const& right, \ - cudf::ast::operation binary_pred, \ - cudf::null_equality compare_nulls) { \ - return cudf::conditional_left_semi_join(left, right, binary_pred); \ - }; \ - BM_join(st, join); \ - } - -CONDITIONAL_LEFT_SEMI_JOIN_BENCHMARK_DEFINE(conditional_left_semi_join_32bit, int32_t, false); -CONDITIONAL_LEFT_SEMI_JOIN_BENCHMARK_DEFINE(conditional_left_semi_join_64bit, int64_t, false); -CONDITIONAL_LEFT_SEMI_JOIN_BENCHMARK_DEFINE(conditional_left_semi_join_32bit_nulls, int32_t, true); -CONDITIONAL_LEFT_SEMI_JOIN_BENCHMARK_DEFINE(conditional_left_semi_join_64bit_nulls, int64_t, true); - -// inner join ----------------------------------------------------------------------- -BENCHMARK_REGISTER_F(ConditionalJoin, conditional_inner_join_32bit) - ->Unit(benchmark::kMillisecond) - ->Args({100'000, 100'000}) - ->Args({100'000, 400'000}) - ->Args({400'000, 100'000}) - ->Args({100'000, 1'000'000}) - ->UseManualTime(); - -BENCHMARK_REGISTER_F(ConditionalJoin, conditional_inner_join_64bit) - ->Unit(benchmark::kMillisecond) - ->Args({100'000, 100'000}) - ->Args({100'000, 400'000}) - ->Args({400'000, 100'000}) - ->Args({100'000, 1'000'000}) - ->UseManualTime(); - -BENCHMARK_REGISTER_F(ConditionalJoin, conditional_inner_join_32bit_nulls) - ->Unit(benchmark::kMillisecond) - ->Args({100'000, 100'000}) - ->Args({100'000, 400'000}) - ->Args({400'000, 100'000}) - ->Args({100'000, 1'000'000}) - ->UseManualTime(); - -BENCHMARK_REGISTER_F(ConditionalJoin, conditional_inner_join_64bit_nulls) - ->Unit(benchmark::kMillisecond) - ->Args({100'000, 100'000}) - ->Args({100'000, 400'000}) - ->Args({400'000, 100'000}) - ->Args({100'000, 1'000'000}) - ->UseManualTime(); - -// left join ----------------------------------------------------------------------- -BENCHMARK_REGISTER_F(ConditionalJoin, conditional_left_join_32bit) - ->Unit(benchmark::kMillisecond) - ->Args({100'000, 100'000}) - ->Args({100'000, 400'000}) - ->Args({100'000, 1'000'000}) - ->UseManualTime(); - -BENCHMARK_REGISTER_F(ConditionalJoin, conditional_left_join_64bit) - ->Unit(benchmark::kMillisecond) - ->Args({100'000, 100'000}) - ->Args({100'000, 400'000}) - ->Args({100'000, 1'000'000}) - ->UseManualTime(); - -BENCHMARK_REGISTER_F(ConditionalJoin, conditional_left_join_32bit_nulls) - ->Unit(benchmark::kMillisecond) - ->Args({100'000, 100'000}) - ->Args({100'000, 400'000}) - ->Args({100'000, 1'000'000}) - ->UseManualTime(); - -BENCHMARK_REGISTER_F(ConditionalJoin, conditional_left_join_64bit_nulls) - ->Unit(benchmark::kMillisecond) - ->Args({100'000, 100'000}) - ->Args({100'000, 400'000}) - ->Args({100'000, 1'000'000}) - ->UseManualTime(); - -// full join ----------------------------------------------------------------------- -BENCHMARK_REGISTER_F(ConditionalJoin, conditional_full_join_32bit) - ->Unit(benchmark::kMillisecond) - ->Args({100'000, 100'000}) - ->Args({100'000, 400'000}) - ->Args({100'000, 1'000'000}) - ->UseManualTime(); - -BENCHMARK_REGISTER_F(ConditionalJoin, conditional_full_join_64bit) - ->Unit(benchmark::kMillisecond) - ->Args({100'000, 100'000}) - ->Args({100'000, 400'000}) - ->Args({100'000, 1'000'000}) - ->UseManualTime(); - -BENCHMARK_REGISTER_F(ConditionalJoin, conditional_full_join_32bit_nulls) - ->Unit(benchmark::kMillisecond) - ->Args({100'000, 100'000}) - ->Args({100'000, 400'000}) - ->Args({100'000, 1'000'000}) - ->UseManualTime(); - -BENCHMARK_REGISTER_F(ConditionalJoin, conditional_full_join_64bit_nulls) - ->Unit(benchmark::kMillisecond) - ->Args({100'000, 100'000}) - ->Args({100'000, 400'000}) - ->Args({100'000, 1'000'000}) - ->UseManualTime(); - -// left anti-join ------------------------------------------------------------- -BENCHMARK_REGISTER_F(ConditionalJoin, conditional_left_anti_join_32bit) - ->Unit(benchmark::kMillisecond) - ->Args({100'000, 100'000}) - ->Args({100'000, 400'000}) - ->Args({100'000, 1'000'000}) - ->UseManualTime(); - -BENCHMARK_REGISTER_F(ConditionalJoin, conditional_left_anti_join_64bit) - ->Unit(benchmark::kMillisecond) - ->Args({100'000, 100'000}) - ->Args({100'000, 400'000}) - ->Args({100'000, 1'000'000}) - ->UseManualTime(); - -BENCHMARK_REGISTER_F(ConditionalJoin, conditional_left_anti_join_32bit_nulls) - ->Unit(benchmark::kMillisecond) - ->Args({100'000, 100'000}) - ->Args({100'000, 400'000}) - ->Args({100'000, 1'000'000}) - ->UseManualTime(); - -BENCHMARK_REGISTER_F(ConditionalJoin, conditional_left_anti_join_64bit_nulls) - ->Unit(benchmark::kMillisecond) - ->Args({100'000, 100'000}) - ->Args({100'000, 400'000}) - ->Args({100'000, 1'000'000}) - ->UseManualTime(); - -// left semi-join ------------------------------------------------------------- -BENCHMARK_REGISTER_F(ConditionalJoin, conditional_left_semi_join_32bit) - ->Unit(benchmark::kMillisecond) - ->Args({100'000, 100'000}) - ->Args({100'000, 400'000}) - ->Args({100'000, 1'000'000}) - ->UseManualTime(); - -BENCHMARK_REGISTER_F(ConditionalJoin, conditional_left_semi_join_64bit) - ->Unit(benchmark::kMillisecond) - ->Args({100'000, 100'000}) - ->Args({100'000, 400'000}) - ->Args({100'000, 1'000'000}) - ->UseManualTime(); - -BENCHMARK_REGISTER_F(ConditionalJoin, conditional_left_semi_join_32bit_nulls) - ->Unit(benchmark::kMillisecond) - ->Args({100'000, 100'000}) - ->Args({100'000, 400'000}) - ->Args({100'000, 1'000'000}) - ->UseManualTime(); - -BENCHMARK_REGISTER_F(ConditionalJoin, conditional_left_semi_join_64bit_nulls) - ->Unit(benchmark::kMillisecond) - ->Args({100'000, 100'000}) - ->Args({100'000, 400'000}) - ->Args({100'000, 1'000'000}) - ->UseManualTime(); +#include "join_common.hpp" + +template +void nvbench_conditional_inner_join(nvbench::state& state, + nvbench::type_list>) +{ + auto join = [](cudf::table_view const& left, + cudf::table_view const& right, + cudf::ast::operation binary_pred, + cudf::null_equality compare_nulls) { + return cudf::conditional_inner_join(left, right, binary_pred); + }; + BM_join(state, join); +} + +template +void nvbench_conditional_left_join(nvbench::state& state, + nvbench::type_list>) +{ + auto join = [](cudf::table_view const& left, + cudf::table_view const& right, + cudf::ast::operation binary_pred, + cudf::null_equality compare_nulls) { + return cudf::conditional_left_join(left, right, binary_pred); + }; + BM_join(state, join); +} + +NVBENCH_BENCH_TYPES(nvbench_conditional_inner_join, + NVBENCH_TYPE_AXES(JOIN_KEY_TYPE_RANGE, JOIN_NULLABLE_RANGE)) + .set_name("conditional_inner_join") + .set_type_axes_names({"Key", "Nullable"}) + .add_int64_axis("left_size", JOIN_SIZE_RANGE) + .add_int64_axis("right_size", JOIN_SIZE_RANGE); + +NVBENCH_BENCH_TYPES(nvbench_conditional_left_join, + NVBENCH_TYPE_AXES(JOIN_KEY_TYPE_RANGE, JOIN_NULLABLE_RANGE)) + .set_name("conditional_left_join") + .set_type_axes_names({"Key", "Nullable"}) + .add_int64_axis("left_size", JOIN_SIZE_RANGE) + .add_int64_axis("right_size", JOIN_SIZE_RANGE); diff --git a/cpp/benchmarks/join/join_common.hpp b/cpp/benchmarks/join/join_common.hpp index e6792b9dbfb..3d9d9c57548 100644 --- a/cpp/benchmarks/join/join_common.hpp +++ b/cpp/benchmarks/join/join_common.hpp @@ -19,7 +19,6 @@ #include "generate_input_tables.cuh" #include -#include #include #include @@ -67,28 +66,12 @@ template void BM_join(state_type& state, Join JoinFunc) { - auto const right_size = [&]() { - if constexpr (std::is_same_v) { - return static_cast(state.range(0)); - } - if constexpr (std::is_same_v) { - return static_cast(state.get_int64("right_size")); - } - }(); - auto const left_size = [&]() { - if constexpr (std::is_same_v) { - return static_cast(state.range(1)); - } - if constexpr (std::is_same_v) { - return static_cast(state.get_int64("left_size")); - } - }(); + auto const right_size = static_cast(state.get_int64("right_size")); + auto const left_size = static_cast(state.get_int64("left_size")); - if constexpr (std::is_same_v) { - if (right_size > left_size) { - state.skip("Skip large right table"); - return; - } + if (right_size > left_size) { + state.skip("Skip large right table"); + return; } double const selectivity = 0.3; @@ -165,57 +148,37 @@ void BM_join(state_type& state, Join JoinFunc) // Setup join parameters and result table [[maybe_unused]] std::vector columns_to_join = {0}; - - // Benchmark the inner join operation - if constexpr (std::is_same_v and - (join_type != join_t::CONDITIONAL)) { - for (auto _ : state) { - cuda_event_timer raii(state, true, cudf::get_default_stream()); - - auto result = JoinFunc(left_table.select(columns_to_join), - right_table.select(columns_to_join), - cudf::null_equality::UNEQUAL); - } - } - if constexpr (std::is_same_v and (join_type != join_t::CONDITIONAL)) { - state.set_cuda_stream(nvbench::make_cuda_stream_view(cudf::get_default_stream().value())); - if constexpr (join_type == join_t::MIXED) { - auto const col_ref_left_0 = cudf::ast::column_reference(0); - auto const col_ref_right_0 = - cudf::ast::column_reference(0, cudf::ast::table_reference::RIGHT); - auto left_zero_eq_right_zero = - cudf::ast::operation(cudf::ast::ast_operator::EQUAL, col_ref_left_0, col_ref_right_0); - state.exec(nvbench::exec_tag::sync, [&](nvbench::launch& launch) { - auto result = JoinFunc(left_table.select(columns_to_join), - right_table.select(columns_to_join), - left_table.select({1}), - right_table.select({1}), - left_zero_eq_right_zero, - cudf::null_equality::UNEQUAL); - }); - } - if constexpr (join_type == join_t::HASH) { - state.exec(nvbench::exec_tag::sync, [&](nvbench::launch& launch) { - auto result = JoinFunc(left_table.select(columns_to_join), - right_table.select(columns_to_join), - cudf::null_equality::UNEQUAL); - }); - } - } - - // Benchmark conditional join - if constexpr (std::is_same_v and join_type == join_t::CONDITIONAL) { - // Common column references. + state.set_cuda_stream(nvbench::make_cuda_stream_view(cudf::get_default_stream().value())); + if constexpr (join_type == join_t::CONDITIONAL) { auto const col_ref_left_0 = cudf::ast::column_reference(0); auto const col_ref_right_0 = cudf::ast::column_reference(0, cudf::ast::table_reference::RIGHT); auto left_zero_eq_right_zero = cudf::ast::operation(cudf::ast::ast_operator::EQUAL, col_ref_left_0, col_ref_right_0); - - for (auto _ : state) { - cuda_event_timer raii(state, true, cudf::get_default_stream()); - + state.exec(nvbench::exec_tag::sync, [&](nvbench::launch& launch) { auto result = JoinFunc(left_table, right_table, left_zero_eq_right_zero, cudf::null_equality::UNEQUAL); - } + ; + }); + } + if constexpr (join_type == join_t::MIXED) { + auto const col_ref_left_0 = cudf::ast::column_reference(0); + auto const col_ref_right_0 = cudf::ast::column_reference(0, cudf::ast::table_reference::RIGHT); + auto left_zero_eq_right_zero = + cudf::ast::operation(cudf::ast::ast_operator::EQUAL, col_ref_left_0, col_ref_right_0); + state.exec(nvbench::exec_tag::sync, [&](nvbench::launch& launch) { + auto result = JoinFunc(left_table.select(columns_to_join), + right_table.select(columns_to_join), + left_table.select({1}), + right_table.select({1}), + left_zero_eq_right_zero, + cudf::null_equality::UNEQUAL); + }); + } + if constexpr (join_type == join_t::HASH) { + state.exec(nvbench::exec_tag::sync, [&](nvbench::launch& launch) { + auto result = JoinFunc(left_table.select(columns_to_join), + right_table.select(columns_to_join), + cudf::null_equality::UNEQUAL); + }); } } diff --git a/cpp/benchmarks/join/left_join.cu b/cpp/benchmarks/join/left_join.cu index 3e398e721fa..92123ce1621 100644 --- a/cpp/benchmarks/join/left_join.cu +++ b/cpp/benchmarks/join/left_join.cu @@ -14,115 +14,43 @@ * limitations under the License. */ -#include - -template -class Join : public cudf::benchmark {}; - -#define LEFT_ANTI_JOIN_BENCHMARK_DEFINE(name, Key, Nullable) \ - BENCHMARK_TEMPLATE_DEFINE_F(Join, name, Key) \ - (::benchmark::State & st) \ - { \ - auto join = [](cudf::table_view const& left, \ - cudf::table_view const& right, \ - cudf::null_equality compare_nulls) { \ - return cudf::left_anti_join(left, right, compare_nulls); \ - }; \ - BM_join(st, join); \ - } - -LEFT_ANTI_JOIN_BENCHMARK_DEFINE(left_anti_join_32bit, int32_t, false); -LEFT_ANTI_JOIN_BENCHMARK_DEFINE(left_anti_join_64bit, int64_t, false); -LEFT_ANTI_JOIN_BENCHMARK_DEFINE(left_anti_join_32bit_nulls, int32_t, true); -LEFT_ANTI_JOIN_BENCHMARK_DEFINE(left_anti_join_64bit_nulls, int64_t, true); - -#define LEFT_SEMI_JOIN_BENCHMARK_DEFINE(name, Key, Nullable) \ - BENCHMARK_TEMPLATE_DEFINE_F(Join, name, Key) \ - (::benchmark::State & st) \ - { \ - auto join = [](cudf::table_view const& left, \ - cudf::table_view const& right, \ - cudf::null_equality compare_nulls) { \ - return cudf::left_semi_join(left, right, compare_nulls); \ - }; \ - BM_join(st, join); \ - } - -LEFT_SEMI_JOIN_BENCHMARK_DEFINE(left_semi_join_32bit, int32_t, false); -LEFT_SEMI_JOIN_BENCHMARK_DEFINE(left_semi_join_64bit, int64_t, false); -LEFT_SEMI_JOIN_BENCHMARK_DEFINE(left_semi_join_32bit_nulls, int32_t, true); -LEFT_SEMI_JOIN_BENCHMARK_DEFINE(left_semi_join_64bit_nulls, int64_t, true); - -// left anti-join ------------------------------------------------------------- -BENCHMARK_REGISTER_F(Join, left_anti_join_32bit) - ->Unit(benchmark::kMillisecond) - ->Args({100'000, 100'000}) - ->Args({100'000, 400'000}) - ->Args({100'000, 1'000'000}) - ->Args({10'000'000, 10'000'000}) - ->Args({10'000'000, 40'000'000}) - ->Args({10'000'000, 100'000'000}) - ->Args({100'000'000, 100'000'000}) - ->Args({80'000'000, 240'000'000}) - ->UseManualTime(); - -BENCHMARK_REGISTER_F(Join, left_anti_join_64bit) - ->Unit(benchmark::kMillisecond) - ->Args({50'000'000, 50'000'000}) - ->Args({40'000'000, 120'000'000}) - ->UseManualTime(); - -BENCHMARK_REGISTER_F(Join, left_anti_join_32bit_nulls) - ->Unit(benchmark::kMillisecond) - ->Args({100'000, 100'000}) - ->Args({100'000, 400'000}) - ->Args({100'000, 1'000'000}) - ->Args({10'000'000, 10'000'000}) - ->Args({10'000'000, 40'000'000}) - ->Args({10'000'000, 100'000'000}) - ->Args({100'000'000, 100'000'000}) - ->Args({80'000'000, 240'000'000}) - ->UseManualTime(); - -BENCHMARK_REGISTER_F(Join, left_anti_join_64bit_nulls) - ->Unit(benchmark::kMillisecond) - ->Args({50'000'000, 50'000'000}) - ->Args({40'000'000, 120'000'000}) - ->UseManualTime(); - -// left semi-join ------------------------------------------------------------- -BENCHMARK_REGISTER_F(Join, left_semi_join_32bit) - ->Unit(benchmark::kMillisecond) - ->Args({100'000, 100'000}) - ->Args({100'000, 400'000}) - ->Args({100'000, 1'000'000}) - ->Args({10'000'000, 10'000'000}) - ->Args({10'000'000, 40'000'000}) - ->Args({10'000'000, 100'000'000}) - ->Args({100'000'000, 100'000'000}) - ->Args({80'000'000, 240'000'000}) - ->UseManualTime(); - -BENCHMARK_REGISTER_F(Join, left_semi_join_64bit) - ->Unit(benchmark::kMillisecond) - ->Args({50'000'000, 50'000'000}) - ->Args({40'000'000, 120'000'000}) - ->UseManualTime(); - -BENCHMARK_REGISTER_F(Join, left_semi_join_32bit_nulls) - ->Unit(benchmark::kMillisecond) - ->Args({100'000, 100'000}) - ->Args({100'000, 400'000}) - ->Args({100'000, 1'000'000}) - ->Args({10'000'000, 10'000'000}) - ->Args({10'000'000, 40'000'000}) - ->Args({10'000'000, 100'000'000}) - ->Args({100'000'000, 100'000'000}) - ->Args({80'000'000, 240'000'000}) - ->UseManualTime(); - -BENCHMARK_REGISTER_F(Join, left_semi_join_64bit_nulls) - ->Unit(benchmark::kMillisecond) - ->Args({50'000'000, 50'000'000}) - ->Args({40'000'000, 120'000'000}) - ->UseManualTime(); +#include "join_common.hpp" + +template +void nvbench_left_anti_join(nvbench::state& state, + nvbench::type_list>) +{ + auto join = [](cudf::table_view const& left, + cudf::table_view const& right, + cudf::null_equality compare_nulls) { + return cudf::left_anti_join(left, right, compare_nulls); + }; + + BM_join(state, join); +} + +template +void nvbench_left_semi_join(nvbench::state& state, + nvbench::type_list>) +{ + auto join = [](cudf::table_view const& left, + cudf::table_view const& right, + cudf::null_equality compare_nulls) { + return cudf::left_semi_join(left, right, compare_nulls); + }; + BM_join(state, join); +} + +NVBENCH_BENCH_TYPES(nvbench_left_anti_join, + NVBENCH_TYPE_AXES(JOIN_KEY_TYPE_RANGE, JOIN_NULLABLE_RANGE)) + .set_name("left_anti_join") + .set_type_axes_names({"Key", "Nullable"}) + .add_int64_axis("left_size", JOIN_SIZE_RANGE) + .add_int64_axis("right_size", JOIN_SIZE_RANGE); + +NVBENCH_BENCH_TYPES(nvbench_left_semi_join, + NVBENCH_TYPE_AXES(JOIN_KEY_TYPE_RANGE, JOIN_NULLABLE_RANGE)) + .set_name("left_semi_join") + .set_type_axes_names({"Key", "Nullable"}) + .add_int64_axis("left_size", JOIN_SIZE_RANGE) + .add_int64_axis("right_size", JOIN_SIZE_RANGE);