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

Function BenchmarkBitRunReader

cpp/src/arrow/util/bit_util_benchmark.cc:221–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219
220template <typename BitRunReaderType>
221static void BenchmarkBitRunReader(benchmark::State& state, int64_t set_percentage) {
222 constexpr int64_t kNumBits = 4096;
223 auto buffer = CreateRandomBitsBuffer(kNumBits, set_percentage);
224
225 for (auto _ : state) {
226 {
227 BitRunReaderType reader(buffer->data(), 0, kNumBits);
228 int64_t set_total = 0;
229 internal::BitRun br;
230 do {
231 br = reader.NextRun();
232 set_total += br.set ? br.length : 0;
233 } while (br.length != 0);
234 benchmark::DoNotOptimize(set_total);
235 }
236 }
237 state.SetBytesProcessed(state.iterations() * (kNumBits / 8));
238}
239
240template <typename SetBitRunReaderType>
241static void BenchmarkSetBitRunReader(benchmark::State& state, int64_t set_percentage) {

Callers

nothing calls this directly

Calls 3

CreateRandomBitsBufferFunction · 0.85
dataMethod · 0.45
NextRunMethod · 0.45

Tested by

no test coverage detected