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

Function BM_ReadStructOfListColumn

cpp/src/parquet/arrow/reader_writer_benchmark.cc:682–702  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

680BENCHMARK(BM_ReadStructOfStructColumn)->Apply(NestedReadArguments);
681
682static void BM_ReadStructOfListColumn(::benchmark::State& state) {
683 constexpr int64_t kNumValues = BENCHMARK_SIZE / 10;
684 const double null_probability = static_cast<double>(state.range(0)) / 100.0;
685 const bool nullable = (null_probability != 0.0);
686
687 ARROW_CHECK_GE(null_probability, 0.0);
688
689 ::arrow::random::RandomArrayGenerator rng(42);
690
691 const int64_t kBytesPerValue = sizeof(int32_t) + sizeof(int64_t);
692
693 auto values1 = rng.Int32(kNumValues, -5, 5, null_probability);
694 auto values2 =
695 rng.Int64(kNumValues, -12345678912345LL, 12345678912345LL, null_probability);
696 auto list1 = rng.List(*values1, kNumValues / 10, null_probability);
697 auto list2 = rng.List(*values2, kNumValues / 10, null_probability);
698 auto array = MakeStructArray(&rng, {list1, list2}, null_probability,
699 /*propagate_validity =*/true);
700
701 BenchmarkReadArray(state, array, nullable, kNumValues, kBytesPerValue * kNumValues);
702}
703
704BENCHMARK(BM_ReadStructOfListColumn)->Apply(NestedReadArguments);
705

Callers

nothing calls this directly

Calls 5

MakeStructArrayFunction · 0.85
BenchmarkReadArrayFunction · 0.85
Int32Method · 0.80
Int64Method · 0.45
ListMethod · 0.45

Tested by

no test coverage detected