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

Function BM_ReadStructOfListColumn

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

Source from the content-addressed store, hash-verified

638BENCHMARK(BM_ReadStructOfStructColumn)->Apply(NestedReadArguments);
639
640static void BM_ReadStructOfListColumn(::benchmark::State& state) {
641 constexpr int64_t kNumValues = BENCHMARK_SIZE / 10;
642 const double null_probability = static_cast<double>(state.range(0)) / 100.0;
643 const bool nullable = (null_probability != 0.0);
644
645 ARROW_CHECK_GE(null_probability, 0.0);
646
647 ::arrow::random::RandomArrayGenerator rng(42);
648
649 const int64_t kBytesPerValue = sizeof(int32_t) + sizeof(int64_t);
650
651 auto values1 = rng.Int32(kNumValues, -5, 5, null_probability);
652 auto values2 =
653 rng.Int64(kNumValues, -12345678912345LL, 12345678912345LL, null_probability);
654 auto list1 = rng.List(*values1, kNumValues / 10, null_probability);
655 auto list2 = rng.List(*values2, kNumValues / 10, null_probability);
656 auto array = MakeStructArray(&rng, {list1, list2}, null_probability,
657 /*propagate_validity =*/true);
658
659 BenchmarkReadArray(state, array, nullable, kNumValues, kBytesPerValue * kNumValues);
660}
661
662BENCHMARK(BM_ReadStructOfListColumn)->Apply(NestedReadArguments);
663

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