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

Function RecordReaderSkipRecords

cpp/src/parquet/column_reader_benchmark.cc:178–199  ·  view source on GitHub ↗

Benchmarks SkipRecords for RecordReader with the following parameters in order: - repetition: 0 for REQUIRED, 1 for OPTIONAL, 2 for REPEATED. - batch_size: sets how many values to read at each call.

Source from the content-addressed store, hash-verified

176// - repetition: 0 for REQUIRED, 1 for OPTIONAL, 2 for REPEATED.
177// - batch_size: sets how many values to read at each call.
178static void RecordReaderSkipRecords(::benchmark::State& state) {
179 const auto repetition = static_cast<Repetition::type>(state.range(0));
180 const auto batch_size = static_cast<int64_t>(state.range(1));
181
182 BenchmarkHelper helper(repetition, /*num_pages=*/16, /*levels_per_page=*/80000);
183
184 // Vectors to read the values into.
185 for (auto _ : state) {
186 state.PauseTiming();
187 // read_dense_for_nullable should not matter for skip.
188 RecordReader* reader = helper.ResetRecordReader(/*read_dense_for_nullable=*/false);
189 int64_t records_skipped = -1;
190 state.ResumeTiming();
191 while (records_skipped != 0) {
192 DoNotOptimize(records_skipped = reader->SkipRecords(batch_size));
193 reader->Reset();
194 }
195 }
196
197 state.SetBytesProcessed(state.iterations() * helper.total_size());
198 state.SetItemsProcessed(state.iterations() * helper.total_levels());
199}
200
201// Benchmarks ReadRecords and SkipRecords for RecordReader with the following parameters
202// in order:

Callers

nothing calls this directly

Calls 5

ResetRecordReaderMethod · 0.80
SkipRecordsMethod · 0.80
total_sizeMethod · 0.80
total_levelsMethod · 0.80
ResetMethod · 0.45

Tested by

no test coverage detected