westonpace commented on code in PR #13314:
URL: https://github.com/apache/arrow/pull/13314#discussion_r890607751


##########
cpp/src/arrow/compute/exec/project_benchmark.cc:
##########
@@ -0,0 +1,100 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "benchmark/benchmark.h"
+
+#include "arrow/compute/cast.h"
+#include "arrow/compute/exec.h"
+#include "arrow/compute/exec/expression.h"
+#include "arrow/compute/exec/options.h"
+#include "arrow/compute/exec/test_util.h"
+#include "arrow/dataset/partition.h"
+#include "arrow/testing/future_util.h"
+#include "arrow/testing/generator.h"
+#include "arrow/testing/gtest_util.h"
+#include "arrow/type.h"
+
+namespace arrow {
+namespace compute {
+
+static constexpr int64_t total_batch_size = 1e5;
+
+void SetArgs(benchmark::internal::Benchmark* bench) {
+  bench->ArgNames({"batch_size"})
+      ->RangeMultiplier(10)
+      ->Range(1, total_batch_size)
+      ->DenseThreadRange(1, std::thread::hardware_concurrency(),
+                         std::thread::hardware_concurrency())

Review Comment:
   If you do this...
   ```
     ExecContext ctx(default_memory_pool(), 
arrow::internal::GetCpuThreadPool());
   ```
   
   ...then it will use one thread per core (i.e. 
`std::thread::hardware_concurrency`).  You can create your own thread pool if 
you need finer grained control over the number of threads (but I don't think 
that is necessary here).



-- 
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]

Reply via email to