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

Function ScanOnlyBench

cpp/src/arrow/dataset/scanner_benchmark.cc:232–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232static void ScanOnlyBench(benchmark::State& state) {
233 size_t num_batches = state.range(0);
234 size_t batch_size = state.range(1);
235
236 std::function<Result<std::shared_ptr<acero::ExecNodeOptions>>(size_t, size_t)>
237 options_factory;
238 std::string scan_factory = "scan";
239 if (state.range(2) == kScanIdx) {
240 options_factory = kScanFactory;
241 } else if (state.range(2) == kScanV2Idx) {
242 options_factory = kScanV2Factory;
243 scan_factory = "scan2";
244 }
245
246 for (auto _ : state) {
247 ScanOnly(num_batches, batch_size, scan_factory, options_factory);
248 }
249 state.SetItemsProcessed(state.iterations() * num_batches);
250 state.SetBytesProcessed(state.iterations() * num_batches * batch_size *
251 GetBytesForSchema());
252}
253
254static void ScanBenchmark_Customize(benchmark::internal::Benchmark* b) {
255 for (const int32_t num_batches : {1000}) {

Callers

nothing calls this directly

Calls 2

ScanOnlyFunction · 0.85
GetBytesForSchemaFunction · 0.85

Tested by

no test coverage detected