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

Function BitmapUInt64Reader

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

Source from the content-addressed store, hash-verified

340}
341
342static void BitmapUInt64Reader(benchmark::State& state) {
343 const int64_t nbytes = state.range(0);
344 std::shared_ptr<Buffer> buffer = CreateRandomBuffer(nbytes);
345
346 const int64_t num_bits = nbytes * 8;
347 const uint8_t* bitmap = buffer->data();
348
349 for (auto _ : state) {
350 {
351 internal::BitmapUInt64Reader reader(bitmap, 0, num_bits);
352 uint64_t total = 0;
353 for (int64_t i = 0; i < num_bits; i += 64) {
354 total += reader.NextWord();
355 }
356 benchmark::DoNotOptimize(total);
357 }
358 }
359 state.SetBytesProcessed(state.iterations() * nbytes);
360}
361
362static void BitRunReader(benchmark::State& state) {
363 BenchmarkBitRunReader<internal::BitRunReader>(state, state.range(0));

Callers

nothing calls this directly

Calls 3

CreateRandomBufferFunction · 0.70
dataMethod · 0.45
NextWordMethod · 0.45

Tested by

no test coverage detected