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

Function BM_ReadOffsetIndex

cpp/src/parquet/page_index_benchmark.cc:37–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37void BM_ReadOffsetIndex(::benchmark::State& state) {
38 auto builder = OffsetIndexBuilder::Make();
39 const int num_pages = static_cast<int>(state.range(0));
40 constexpr int64_t page_size = 1024;
41 constexpr int64_t first_row_index = 10000;
42 for (int i = 0; i < num_pages; ++i) {
43 builder->AddPage(page_size * i, page_size, first_row_index * i);
44 }
45 constexpr int64_t final_position = 4096;
46 builder->Finish(final_position);
47 auto sink = CreateOutputStream();
48 builder->WriteTo(sink.get());
49 auto buffer = sink->Finish().ValueOrDie();
50 ReaderProperties properties;
51 for (auto _ : state) {
52 auto offset_index = OffsetIndex::Make(
53 buffer->data() + 0, static_cast<uint32_t>(buffer->size()), properties);
54 ::benchmark::DoNotOptimize(offset_index);
55 }
56 state.SetBytesProcessed(state.iterations() * buffer->size());
57 state.SetItemsProcessed(state.iterations() * num_pages);
58}
59
60BENCHMARK(BM_ReadOffsetIndex)->Apply(PageIndexSetArgs);
61

Callers

nothing calls this directly

Calls 9

CreateOutputStreamFunction · 0.85
ValueOrDieMethod · 0.80
MakeFunction · 0.70
AddPageMethod · 0.45
FinishMethod · 0.45
WriteToMethod · 0.45
getMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected