Benchmarks ReadBatch for ColumnReader 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.
| 120 | // - repetition: 0 for REQUIRED, 1 for OPTIONAL, 2 for REPEATED. |
| 121 | // - batch_size: sets how many values to read at each call. |
| 122 | static void ColumnReaderReadBatchInt32(::benchmark::State& state) { |
| 123 | const auto repetition = static_cast<Repetition::type>(state.range(0)); |
| 124 | const auto batch_size = static_cast<int64_t>(state.range(1)); |
| 125 | |
| 126 | BenchmarkHelper helper(repetition, /*num_pages=*/16, /*levels_per_page=*/80000); |
| 127 | |
| 128 | // Vectors to read the values into. |
| 129 | std::vector<int32_t> read_values(batch_size, -1); |
| 130 | std::vector<int16_t> read_defs(batch_size, -1); |
| 131 | std::vector<int16_t> read_reps(batch_size, -1); |
| 132 | for (auto _ : state) { |
| 133 | state.PauseTiming(); |
| 134 | Int32Reader* reader = helper.ResetColumnReader(); |
| 135 | int64_t values_count = -1; |
| 136 | state.ResumeTiming(); |
| 137 | while (values_count != 0) { |
| 138 | int64_t values_read = 0; |
| 139 | DoNotOptimize(values_count = |
| 140 | reader->ReadBatch(batch_size, read_defs.data(), read_reps.data(), |
| 141 | read_values.data(), &values_read)); |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | state.SetBytesProcessed(state.iterations() * helper.total_size()); |
| 146 | } |
| 147 | |
| 148 | // Benchmarks ReadRecords for RecordReader with the following parameters in order: |
| 149 | // - repetition: 0 for REQUIRED, 1 for OPTIONAL, 2 for REPEATED. |
nothing calls this directly
no test coverage detected