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

Function RunInSerialExecutor

cpp/src/arrow/util/thread_pool_benchmark.cc:107–120  ·  view source on GitHub ↗

Benchmark SerialExecutor::RunInSerialExecutor

Source from the content-addressed store, hash-verified

105
106// Benchmark SerialExecutor::RunInSerialExecutor
107static void RunInSerialExecutor(benchmark::State& state) { // NOLINT non-const reference
108 const auto workload_size = static_cast<int32_t>(state.range(0));
109
110 Workload workload(workload_size);
111
112 for (auto _ : state) {
113 ABORT_NOT_OK(
114 SerialExecutor::RunInSerialExecutor<Future<>>([&](internal::Executor* executor) {
115 return DeferNotOk(executor->Submit(std::ref(workload)));
116 }));
117 }
118
119 state.SetItemsProcessed(state.iterations());
120}
121
122// Benchmark ThreadPool::Submit
123static void ThreadPoolSubmit(benchmark::State& state) { // NOLINT non-const reference

Callers

nothing calls this directly

Calls 2

DeferNotOkFunction · 0.85
refFunction · 0.85

Tested by

no test coverage detected