You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/12/20 04:15:19 UTC
[GitHub] [arrow] cyb70289 commented on a diff in pull request #15041: GH-14937: [C++] String Sort / Rank Benchmarks
cyb70289 commented on code in PR #15041:
URL: https://github.com/apache/arrow/pull/15041#discussion_r1052891524
##########
cpp/src/arrow/compute/kernels/vector_sort_benchmark.cc:
##########
@@ -95,6 +95,25 @@ 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, int64_t min_length,
+ int64_t max_length) {
+ RegressionArgs args(state);
+
+ const int64_t n_chunks = 10;
+ const int64_t array_size = args.size / n_chunks / sizeof(int64_t);
+ auto rand = random::RandomArrayGenerator(kSeed);
+
+ ArrayVector chunks;
+ for (int64_t i = 0; i < n_chunks; ++i) {
+ chunks.push_back(std::static_pointer_cast<StringArray>(
+ rand.String(array_size, min_length, max_length, args.null_proportion)));
Review Comment:
Is this pointer cast necessary?
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org