felipecrv commented on code in PR #34811:
URL: https://github.com/apache/arrow/pull/34811#discussion_r1154854153
##########
cpp/src/arrow/compute/kernels/vector_sort_benchmark.cc:
##########
@@ -99,6 +99,40 @@ static void
ChunkedArraySortFuncInt64Benchmark(benchmark::State& state,
ArraySortFuncBenchmark(state, runner,
std::make_shared<ChunkedArray>(chunks));
}
+template <typename Runner>
+static void ChunkedArraySortFuncStringBenchmark(benchmark::State& state,
+ const Runner& runner, int32_t
min_length,
+ int32_t max_length) {
+ RegressionArgs args(state);
+
+ // The array_size is derived from these two equations:
+ //
+ // size = array_size * (1.0 - args.null_proportion) * string_mean_length
+ // string_mean_length = (max_length + min_length) / 2.0
+ const double valid_proportion = 1.0 - args.null_proportion;
+ const double array_size =
+ (valid_proportion > std::numeric_limits<double>::epsilon())
+ ? (args.size * 2) / (valid_proportion * (max_length + min_length))
+ : (args.size * 2) / (max_length + min_length);
+
+ const auto n_chunks = 10;
Review Comment:
The other benchmarks also chunk the arrays by 10, so to keeps things
comparable, we should use 10 everywhere.
--
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]