MCPcopy Create free account
hub / github.com/apache/impala / BitReaderBenchmark

Function BitReaderBenchmark

be/src/benchmarks/bit-packing-benchmark.cc:409–422  ·  view source on GitHub ↗

Benchmark calling BitReader::GetValue() in a loop to unpack 32 * 'batch_size' values.

Source from the content-addressed store, hash-verified

407
408/// Benchmark calling BitReader::GetValue() in a loop to unpack 32 * 'batch_size' values.
409void BitReaderBenchmark(int batch_size, void* data) {
410 const BenchmarkParams* p = reinterpret_cast<BenchmarkParams*>(data);
411 BitReader reader(p->data, p->data_len);
412 for (int i = 0; i < batch_size; ++i) {
413 for (int j = 0; j < 32; ++j) {
414 const int64_t offset = (i * 32 + j) % NUM_OUT_VALUES;
415 if (UNLIKELY(!reader.GetValue<uint32_t>(p->bit_width, &out_buffer[offset]))) {
416 reader.Reset(p->data, p->data_len);
417 const bool success = reader.GetValue<uint32_t>(p->bit_width, &out_buffer[offset]);
418 DCHECK(success);
419 }
420 }
421 }
422}
423
424/// Benchmark calling Unpack32Values() in a loop to unpack 32 * 'batch_size' values.
425void Unpack32Benchmark(int batch_size, void* data) {

Callers

nothing calls this directly

Calls 1

ResetMethod · 0.45

Tested by

no test coverage detected