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

Function BitmapEquals

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

Source from the content-addressed store, hash-verified

484// Benchmark the worst case of comparing two identical bitmap
485template <int64_t Offset = 0>
486static void BitmapEquals(benchmark::State& state) {
487 const int64_t buffer_size = state.range(0);
488 const int64_t bits_size = buffer_size * 8;
489 std::shared_ptr<Buffer> buffer = CreateRandomBuffer(buffer_size);
490
491 const uint8_t* src = buffer->data();
492 const int64_t offset = Offset;
493 const int64_t length = bits_size - offset;
494
495 auto copy = *AllocateEmptyBitmap(length + offset);
496 internal::CopyBitmap(src, 0, length, copy->mutable_data(), offset);
497
498 for (auto _ : state) {
499 auto is_same = internal::BitmapEquals(src, 0, copy->data(), offset, length);
500 benchmark::DoNotOptimize(is_same);
501 }
502
503 state.SetBytesProcessed(state.iterations() * buffer_size);
504}
505
506static void BitmapEqualsWithoutOffset(benchmark::State& state) { BitmapEquals<0>(state); }
507

Callers

nothing calls this directly

Calls 5

AllocateEmptyBitmapFunction · 0.85
CreateRandomBufferFunction · 0.70
CopyBitmapFunction · 0.70
dataMethod · 0.45
mutable_dataMethod · 0.45

Tested by

no test coverage detected