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

Function BenchmarkSetBitRunReader

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

Source from the content-addressed store, hash-verified

239
240template <typename SetBitRunReaderType>
241static void BenchmarkSetBitRunReader(benchmark::State& state, int64_t set_percentage) {
242 constexpr int64_t kNumBits = 4096;
243 auto buffer = CreateRandomBitsBuffer(kNumBits, set_percentage);
244
245 for (auto _ : state) {
246 {
247 SetBitRunReaderType reader(buffer->data(), 0, kNumBits);
248 int64_t set_total = 0;
249 internal::SetBitRun br;
250 do {
251 br = reader.NextRun();
252 set_total += br.length;
253 } while (br.length != 0);
254 benchmark::DoNotOptimize(set_total);
255 }
256 }
257 state.SetBytesProcessed(state.iterations() * (kNumBits / 8));
258}
259
260template <typename VisitBitsFunctorType>
261static void BenchmarkVisitBits(benchmark::State& state, int64_t nbytes) {

Callers

nothing calls this directly

Calls 3

CreateRandomBitsBufferFunction · 0.85
dataMethod · 0.45
NextRunMethod · 0.45

Tested by

no test coverage detected