MCPcopy Create free account
hub / github.com/apache/arrow / BinaryJoin

Function BinaryJoin

cpp/src/arrow/compute/kernels/scalar_string_benchmark.cc:144–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142using SeparatorFactory = std::function<Datum(int64_t n, double null_probability)>;
143
144static void BinaryJoin(benchmark::State& state, SeparatorFactory make_separator) {
145 const int64_t n_strings = 10000;
146 const int64_t n_lists = 1000;
147 const double null_probability = 0.02;
148
149 random::RandomArrayGenerator rng(kSeed);
150
151 auto strings =
152 rng.String(n_strings, /*min_length=*/5, /*max_length=*/20, null_probability);
153 auto lists = rng.List(*strings, n_lists, null_probability, /*force_empty_nulls=*/true);
154 auto separator = make_separator(n_lists, null_probability);
155
156 for (auto _ : state) {
157 ABORT_NOT_OK(CallFunction("binary_join", {lists, separator}));
158 }
159 state.SetBytesProcessed(
160 state.iterations() *
161 checked_cast<const StringArray&>(*strings).total_values_length());
162}
163
164static void BinaryJoinArrayScalar(benchmark::State& state) {
165 BinaryJoin(state, [](int64_t n, double null_probability) -> Datum {

Callers 2

BinaryJoinArrayScalarFunction · 0.70
BinaryJoinArrayArrayFunction · 0.70

Calls 4

CallFunctionFunction · 0.85
total_values_lengthMethod · 0.80
StringMethod · 0.45
ListMethod · 0.45

Tested by

no test coverage detected