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

Function CopyBitmap

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

Source from the content-addressed store, hash-verified

452
453template <int64_t OffsetSrc, int64_t OffsetDest = 0>
454static void CopyBitmap(benchmark::State& state) { // NOLINT non-const reference
455 const int64_t buffer_size = state.range(0);
456 const int64_t bits_size = buffer_size * 8;
457 std::shared_ptr<Buffer> buffer = CreateRandomBuffer(buffer_size);
458
459 const uint8_t* src = buffer->data();
460 const int64_t length = bits_size - OffsetSrc;
461
462 auto copy = *AllocateEmptyBitmap(length + OffsetDest);
463
464 for (auto _ : state) {
465 internal::CopyBitmap(src, OffsetSrc, length, copy->mutable_data(), OffsetDest);
466 }
467
468 state.SetBytesProcessed(state.iterations() * buffer_size);
469}
470
471static void CopyBitmapWithoutOffset(
472 benchmark::State& state) { // NOLINT non-const reference

Callers 1

BitmapEqualsFunction · 0.70

Calls 4

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

Tested by

no test coverage detected