Benchmarks ReadRecords 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. - read_dense_for_nullable: sets reading dense or spaced.
| 150 | // - batch_size: sets how many values to read at each call. |
| 151 | // - read_dense_for_nullable: sets reading dense or spaced. |
| 152 | static void RecordReaderReadRecords(::benchmark::State& state) { |
| 153 | const auto repetition = static_cast<Repetition::type>(state.range(0)); |
| 154 | const auto batch_size = static_cast<int64_t>(state.range(1)); |
| 155 | const bool read_dense_for_nullable = state.range(2); |
| 156 | |
| 157 | BenchmarkHelper helper(repetition, /*num_pages=*/16, /*levels_per_page=*/80000); |
| 158 | |
| 159 | // Vectors to read the values into. |
| 160 | for (auto _ : state) { |
| 161 | state.PauseTiming(); |
| 162 | RecordReader* reader = helper.ResetRecordReader(read_dense_for_nullable); |
| 163 | int64_t records_read = -1; |
| 164 | state.ResumeTiming(); |
| 165 | while (records_read != 0) { |
| 166 | DoNotOptimize(records_read = reader->ReadRecords(batch_size)); |
| 167 | reader->Reset(); |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | state.SetBytesProcessed(state.iterations() * helper.total_size()); |
| 172 | state.SetItemsProcessed(state.iterations() * helper.total_levels()); |
| 173 | } |
| 174 | |
| 175 | // Benchmarks SkipRecords for RecordReader with the following parameters in order: |
| 176 | // - repetition: 0 for REQUIRED, 1 for OPTIONAL, 2 for REPEATED. |
nothing calls this directly
no test coverage detected